From 37399f88dbcd9bce873a62b89d5d979e43da5eb7 Mon Sep 17 00:00:00 2001 From: Mateusz Uzdowski Date: Fri, 11 May 2012 16:07:07 +1200 Subject: [PATCH] BUGFIX: add missing _super calls to all matchers and unmatchers Otherwise some matchers might not be triggered as expected. --- admin/javascript/LeftAndMain.Content.js | 2 ++ admin/javascript/LeftAndMain.Menu.js | 3 ++- admin/javascript/LeftAndMain.Preview.js | 7 ++++++- admin/javascript/LeftAndMain.Tree.js | 4 +--- admin/javascript/LeftAndMain.js | 12 ++++++++++-- javascript/GridField.js | 1 + javascript/HtmlEditorField.js | 1 + javascript/UploadField.js | 4 +++- 8 files changed, 26 insertions(+), 8 deletions(-) diff --git a/admin/javascript/LeftAndMain.Content.js b/admin/javascript/LeftAndMain.Content.js index 6a34704ec..0a102ced0 100644 --- a/admin/javascript/LeftAndMain.Content.js +++ b/admin/javascript/LeftAndMain.Content.js @@ -234,8 +234,10 @@ $('.cms-content.loading,.cms-edit-form.loading,.cms-content-fields.loading,.cms-content-view.loading').entwine({ onmatch: function() { this.append('
'); + this._super(); }, onunmatch: function() { + this._super(); this.find('.cms-content-loading-overlay,.cms-content-loading-spinner').remove(); } }); diff --git a/admin/javascript/LeftAndMain.Menu.js b/admin/javascript/LeftAndMain.Menu.js index 9eae6f928..5eacfc4b3 100644 --- a/admin/javascript/LeftAndMain.Menu.js +++ b/admin/javascript/LeftAndMain.Menu.js @@ -150,6 +150,7 @@ if(this.find('ul').length) { this.find('a:first').append(''); } + this._super(); }, toggle: function() { this[this.hasClass('opened') ? 'close' : 'open'](); @@ -238,4 +239,4 @@ }); }); -}(jQuery)); \ No newline at end of file +}(jQuery)); diff --git a/admin/javascript/LeftAndMain.Preview.js b/admin/javascript/LeftAndMain.Preview.js index 50194d6cd..d9134fd63 100644 --- a/admin/javascript/LeftAndMain.Preview.js +++ b/admin/javascript/LeftAndMain.Preview.js @@ -193,21 +193,25 @@ $('.cms-preview.collapsed').entwine({ onmatch: function() { this.find('a').text('<'); + this._super(); } }); $('.cms-preview.blocked').entwine({ onmatch: function() { this.find('.cms-preview-overlay').show(); + this._super(); }, onunmatch: function() { this.find('.cms-preview-overlay').hide(); + this._super(); } }); $('.cms-preview.expanded').entwine({ onmatch: function() { this.find('a').text('>'); + this._super(); } }); @@ -244,6 +248,7 @@ this.find('.active a').removeClass('disabled'); this.find('.cms-preview-watermark').show(); this.find('.active .cms-preview-watermark').hide(); + this._super(); } }); @@ -273,4 +278,4 @@ } }); }); -}(jQuery)); \ No newline at end of file +}(jQuery)); diff --git a/admin/javascript/LeftAndMain.Tree.js b/admin/javascript/LeftAndMain.Tree.js index 632579003..af2605875 100644 --- a/admin/javascript/LeftAndMain.Tree.js +++ b/admin/javascript/LeftAndMain.Tree.js @@ -265,10 +265,8 @@ } } - }, - onunmatch: function() { - } + }); $('.cms-tree.multiple').entwine({ diff --git a/admin/javascript/LeftAndMain.js b/admin/javascript/LeftAndMain.js index e6090a976..579c55a39 100644 --- a/admin/javascript/LeftAndMain.js +++ b/admin/javascript/LeftAndMain.js @@ -87,6 +87,8 @@ jQuery.noConflict(); '

' ).css('z-index', $('.ss-loading-screen').css('z-index')+1); $('.loading-animation').remove(); + + this._super(); return; } @@ -459,7 +461,10 @@ jQuery.noConflict(); $('.cms .field.date input.text').entwine({ onmatch: function() { var holder = $(this).parents('.field.date:first'), config = holder.data(); - if(!config.showcalendar) return; + if(!config.showcalendar) { + this._super(); + return; + } config.showOn = 'button'; if(config.locale && $.datepicker.regional[config.locale]) { @@ -485,7 +490,10 @@ jQuery.noConflict(); $('.cms .field.dropdown select, .cms .field select[multiple]').entwine({ 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 if(!this.data('placeholder')) this.data('placeholder', ' '); diff --git a/javascript/GridField.js b/javascript/GridField.js index 55f8f02e0..62fea339e 100644 --- a/javascript/GridField.js +++ b/javascript/GridField.js @@ -255,6 +255,7 @@ filterbtn.addClass('filtered'); resetbtn.addClass('filtered'); } + this._super(); }, onkeydown: function(e) { // Skip reset button events, they should trigger default submission diff --git a/javascript/HtmlEditorField.js b/javascript/HtmlEditorField.js index d619c1f75..c9e6bd964 100644 --- a/javascript/HtmlEditorField.js +++ b/javascript/HtmlEditorField.js @@ -355,6 +355,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE; this.getDialog().attr('title', titleEl.text()); this.setEditor(ss.editorWrappers['default']()); + this._super(); }, redraw: function() { }, diff --git a/javascript/UploadField.js b/javascript/UploadField.js index 83e6ebd5c..3b0996f83 100644 --- a/javascript/UploadField.js +++ b/javascript/UploadField.js @@ -222,11 +222,12 @@ }); $('div.ss-upload .ss-uploadfield-files .ss-uploadfield-item').entwine({ onmatch: function() { - + this._super(); this.closest('.ss-upload').find('.ss-uploadfield-addfile').addClass('borderTop'); }, onunmatch: function() { $('.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({ @@ -387,6 +388,7 @@ this.load(function() { $(this).parent().removeClass('loading'); }); + this._super(); } }); $('div.ss-upload .ss-uploadfield-fromfiles').entwine({