BUGFIX: add missing _super calls to all matchers and unmatchers

Otherwise some matchers might not be triggered as expected.
This commit is contained in:
Mateusz Uzdowski 2012-05-11 16:07:07 +12:00
parent 3d0876c8f5
commit 37399f88db
8 changed files with 26 additions and 8 deletions

View File

@ -234,8 +234,10 @@
$('.cms-content.loading,.cms-edit-form.loading,.cms-content-fields.loading,.cms-content-view.loading').entwine({ $('.cms-content.loading,.cms-edit-form.loading,.cms-content-fields.loading,.cms-content-view.loading').entwine({
onmatch: function() { onmatch: function() {
this.append('<div class="cms-content-loading-overlay ui-widget-overlay-light"></div><div class="cms-content-loading-spinner"></div>'); this.append('<div class="cms-content-loading-overlay ui-widget-overlay-light"></div><div class="cms-content-loading-spinner"></div>');
this._super();
}, },
onunmatch: function() { onunmatch: function() {
this._super();
this.find('.cms-content-loading-overlay,.cms-content-loading-spinner').remove(); this.find('.cms-content-loading-overlay,.cms-content-loading-spinner').remove();
} }
}); });

View File

@ -150,6 +150,7 @@
if(this.find('ul').length) { if(this.find('ul').length) {
this.find('a:first').append('<span class="toggle-children"><span class="toggle-children-icon"></span></span>'); this.find('a:first').append('<span class="toggle-children"><span class="toggle-children-icon"></span></span>');
} }
this._super();
}, },
toggle: function() { toggle: function() {
this[this.hasClass('opened') ? 'close' : 'open'](); this[this.hasClass('opened') ? 'close' : 'open']();

View File

@ -193,21 +193,25 @@
$('.cms-preview.collapsed').entwine({ $('.cms-preview.collapsed').entwine({
onmatch: function() { onmatch: function() {
this.find('a').text('<'); this.find('a').text('<');
this._super();
} }
}); });
$('.cms-preview.blocked').entwine({ $('.cms-preview.blocked').entwine({
onmatch: function() { onmatch: function() {
this.find('.cms-preview-overlay').show(); this.find('.cms-preview-overlay').show();
this._super();
}, },
onunmatch: function() { onunmatch: function() {
this.find('.cms-preview-overlay').hide(); this.find('.cms-preview-overlay').hide();
this._super();
} }
}); });
$('.cms-preview.expanded').entwine({ $('.cms-preview.expanded').entwine({
onmatch: function() { onmatch: function() {
this.find('a').text('>'); this.find('a').text('>');
this._super();
} }
}); });
@ -244,6 +248,7 @@
this.find('.active a').removeClass('disabled'); this.find('.active a').removeClass('disabled');
this.find('.cms-preview-watermark').show(); this.find('.cms-preview-watermark').show();
this.find('.active .cms-preview-watermark').hide(); this.find('.active .cms-preview-watermark').hide();
this._super();
} }
}); });

View File

@ -265,10 +265,8 @@
} }
} }
},
onunmatch: function() {
} }
}); });
$('.cms-tree.multiple').entwine({ $('.cms-tree.multiple').entwine({

View File

@ -87,6 +87,8 @@ jQuery.noConflict();
'</span></p>' '</span></p>'
).css('z-index', $('.ss-loading-screen').css('z-index')+1); ).css('z-index', $('.ss-loading-screen').css('z-index')+1);
$('.loading-animation').remove(); $('.loading-animation').remove();
this._super();
return; return;
} }
@ -459,7 +461,10 @@ jQuery.noConflict();
$('.cms .field.date input.text').entwine({ $('.cms .field.date input.text').entwine({
onmatch: function() { onmatch: function() {
var holder = $(this).parents('.field.date:first'), config = holder.data(); var holder = $(this).parents('.field.date:first'), config = holder.data();
if(!config.showcalendar) return; if(!config.showcalendar) {
this._super();
return;
}
config.showOn = 'button'; config.showOn = 'button';
if(config.locale && $.datepicker.regional[config.locale]) { if(config.locale && $.datepicker.regional[config.locale]) {
@ -485,7 +490,10 @@ jQuery.noConflict();
$('.cms .field.dropdown select, .cms .field select[multiple]').entwine({ $('.cms .field.dropdown select, .cms .field select[multiple]').entwine({
onmatch: function() { onmatch: function() {
if(this.is('.no-chzn')) return; if(this.is('.no-chzn')) {
this._super();
return;
}
// Explicitly disable default placeholder if no custom one is defined // Explicitly disable default placeholder if no custom one is defined
if(!this.data('placeholder')) this.data('placeholder', ' '); if(!this.data('placeholder')) this.data('placeholder', ' ');

View File

@ -255,6 +255,7 @@
filterbtn.addClass('filtered'); filterbtn.addClass('filtered');
resetbtn.addClass('filtered'); resetbtn.addClass('filtered');
} }
this._super();
}, },
onkeydown: function(e) { onkeydown: function(e) {
// Skip reset button events, they should trigger default submission // Skip reset button events, they should trigger default submission

View File

@ -355,6 +355,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
this.getDialog().attr('title', titleEl.text()); this.getDialog().attr('title', titleEl.text());
this.setEditor(ss.editorWrappers['default']()); this.setEditor(ss.editorWrappers['default']());
this._super();
}, },
redraw: function() { redraw: function() {
}, },

View File

@ -222,11 +222,12 @@
}); });
$('div.ss-upload .ss-uploadfield-files .ss-uploadfield-item').entwine({ $('div.ss-upload .ss-uploadfield-files .ss-uploadfield-item').entwine({
onmatch: function() { onmatch: function() {
this._super();
this.closest('.ss-upload').find('.ss-uploadfield-addfile').addClass('borderTop'); this.closest('.ss-upload').find('.ss-uploadfield-addfile').addClass('borderTop');
}, },
onunmatch: function() { onunmatch: function() {
$('.ss-uploadfield-files:not(:has(.ss-uploadfield-item))').closest('.ss-upload').find('.ss-uploadfield-addfile').removeClass('borderTop'); $('.ss-uploadfield-files:not(:has(.ss-uploadfield-item))').closest('.ss-upload').find('.ss-uploadfield-addfile').removeClass('borderTop');
this._super();
} }
}); });
$('div.ss-upload .ss-uploadfield-startall').entwine({ $('div.ss-upload .ss-uploadfield-startall').entwine({
@ -387,6 +388,7 @@
this.load(function() { this.load(function() {
$(this).parent().removeClass('loading'); $(this).parent().removeClass('loading');
}); });
this._super();
} }
}); });
$('div.ss-upload .ss-uploadfield-fromfiles').entwine({ $('div.ss-upload .ss-uploadfield-fromfiles').entwine({