BUGFIX: add missing onunmatches

This commit is contained in:
Mateusz Uzdowski 2012-05-14 11:43:36 +12:00 committed by Sean Harvey
parent bbb08df176
commit 8d469b66c8
21 changed files with 138 additions and 34 deletions

View File

@ -59,7 +59,6 @@
onunmatch: function() { onunmatch: function() {
this._super(); this._super();
}, },
/** /**
* Function: onsubmit * Function: onsubmit
* *

View File

@ -60,7 +60,9 @@
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
/** /**
* Updates the select box state according to the current view mode. * Updates the select box state according to the current view mode.
*/ */
@ -292,7 +294,9 @@
this.trigger('change'); this.trigger('change');
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
/** /**
* Function: onchange * Function: onchange
* *

View File

@ -209,6 +209,9 @@
var tabs = this.find("ul:first").children('li'); var tabs = this.find("ul:first").children('li');
if(tabs.length == 1) this.find('ul:first').hide(); if(tabs.length == 1) this.find('ul:first').hide();
this._super(); this._super();
},
onunmatch: function() {
this._super();
} }
}); });

View File

@ -105,7 +105,9 @@
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
updateItems: function() { updateItems: function() {
// Hide "edit page" commands unless the section is activated // Hide "edit page" commands unless the section is activated
var editPageItem = this.find('#Menu-CMSMain'); var editPageItem = this.find('#Menu-CMSMain');
@ -152,6 +154,9 @@
} }
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
toggle: function() { toggle: function() {
this[this.hasClass('opened') ? 'close' : 'open'](); this[this.hasClass('opened') ? 'close' : 'open']();
}, },

View File

@ -62,7 +62,9 @@
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
/** /**
* @param {Boolean} TRUE to expand, FALSE to collapse. * @param {Boolean} TRUE to expand, FALSE to collapse.
* @param {Boolean} TRUE means that events won't be fired, which is useful for the component initialization phase. * @param {Boolean} TRUE means that events won't be fired, which is useful for the component initialization phase.
@ -138,4 +140,4 @@
} }
}); });
}); });
}(jQuery)); }(jQuery));

View File

@ -16,7 +16,10 @@
// //
// this._setupPinging(); // this._setupPinging();
// }, // },
// onunmatch: function() {
// this._super();
// }
/** /**
* Function: _setupPinging * Function: _setupPinging
* *
@ -47,4 +50,4 @@
} }
}); });
}); });
}(jQuery)); }(jQuery));

View File

@ -89,8 +89,10 @@
this._super(); this._super();
}, },
onunmatch: function() {
loadUrl: function(url) { this._super();
},
loadUrl: function(url) {
this.find('iframe').attr('src', url); this.find('iframe').attr('src', url);
}, },
@ -201,6 +203,9 @@
onmatch: function() { onmatch: function() {
this.find('a').text('<'); this.find('a').text('<');
this._super(); this._super();
},
onunmatch: function() {
this._super();
} }
}); });
@ -219,6 +224,9 @@
onmatch: function() { onmatch: function() {
this.find('a').text('>'); this.find('a').text('>');
this._super(); this._super();
},
onunmatch: function() {
this._super();
} }
}); });
@ -256,6 +264,9 @@
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(); this._super();
},
onunmatch: function() {
this._super();
} }
}); });

View File

@ -332,6 +332,9 @@
this.redraw(); this.redraw();
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
onclick: function(e) { onclick: function(e) {
this.redraw(); this.redraw();
}, },

View File

@ -120,6 +120,9 @@ jQuery.noConflict();
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
redraw: function() { redraw: function() {
// Move from inner to outer layouts. Some of the elements might not exist. // Move from inner to outer layouts. Some of the elements might not exist.
@ -313,6 +316,9 @@ jQuery.noConflict();
onmatch: function() { onmatch: function() {
if(!this.hasClass('ss-ui-button')) this.addClass('ss-ui-button'); if(!this.hasClass('ss-ui-button')) this.addClass('ss-ui-button');
this._super();
},
onunmatch: function() {
this._super(); this._super();
} }
}); });
@ -321,6 +327,9 @@ jQuery.noConflict();
onmatch: function() { onmatch: function() {
if(!this.data('button')) this.button(); if(!this.data('button')) this.button();
this._super();
},
onunmatch: function() {
this._super(); this._super();
} }
}); });
@ -401,6 +410,9 @@ jQuery.noConflict();
this._super(); this._super();
this.setUUID(new Date().getTime()); this.setUUID(new Date().getTime());
}, },
onunmatch: function() {
this._super();
},
onclick: function() { onclick: function() {
this._super(); this._super();
@ -437,6 +449,9 @@ jQuery.noConflict();
this.redraw(); this.redraw();
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
redraw: function() { redraw: function() {
// Remove whitespace to avoid gaps with inline elements // Remove whitespace to avoid gaps with inline elements
this.contents().filter(function() { this.contents().filter(function() {
@ -475,6 +490,9 @@ jQuery.noConflict();
// // Unfortunately jQuery UI only allows configuration of icon images, not sprites // // Unfortunately jQuery UI only allows configuration of icon images, not sprites
// this.next('button').button('option', 'icons', {primary : 'ui-icon-calendar'}); // this.next('button').button('option', 'icons', {primary : 'ui-icon-calendar'});
this._super();
},
onunmatch: function() {
this._super(); this._super();
} }
}); });
@ -505,9 +523,12 @@ jQuery.noConflict();
// Apply Chosen // Apply Chosen
applyChosen(this); applyChosen(this);
this._super();
},
onunmatch: function() {
this._super(); this._super();
} }
}); });
$(".cms-panel-layout").entwine({ $(".cms-panel-layout").entwine({
redraw: function() { redraw: function() {
@ -573,6 +594,9 @@ jQuery.noConflict();
$(this.attr('href')).hide(); $(this.attr('href')).hide();
}, },
onunmatch: function() {
this._super();
},
onclick: function(e) { onclick: function(e) {
$(this.attr('href')).toggle(); $(this.attr('href')).toggle();
e.preventDefault(); e.preventDefault();

View File

@ -11,6 +11,9 @@
this._super(); this._super();
this.hide(); this.hide();
},
onunmatch: function() {
this._super();
} }
}); });
@ -29,4 +32,4 @@
}); });
}); });
}(jQuery)); }(jQuery));

View File

@ -25,8 +25,11 @@
return false; return false;
}); });
this._super();
},
onunmatch: function() {
this._super(); this._super();
} }
}); });
}); });
})(jQuery); })(jQuery);

View File

@ -28,6 +28,9 @@
// TODO entwine can't seem to bind to iframe load events // TODO entwine can't seem to bind to iframe load events
$(this).bind('load', refreshAfterImport); $(this).bind('load', refreshAfterImport);
},
onunmatch: function() {
this._super();
} }
}); });
}); });
@ -46,6 +49,9 @@
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
/** /**
* Function: onclick * Function: onclick
*/ */
@ -75,4 +81,4 @@
}); });
}); });
}(jQuery)); }(jQuery));

View File

@ -13,7 +13,6 @@
onunmatch: function() { onunmatch: function() {
this._super(); this._super();
}, },
redraw: function() { redraw: function() {
this.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-panel ui-corner-bottom'); this.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-panel ui-corner-bottom');
this.find('ul').addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all'); this.find('ul').addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');

View File

@ -6,12 +6,14 @@
// Hide the "second step" part until we're actually uploading // Hide the "second step" part until we're actually uploading
this.find('.ss-uploadfield-editandorganize').hide(); this.find('.ss-uploadfield-editandorganize').hide();
}, },
onunmatch: function() {
this._super();
},
onfileuploadadd: function(e) { onfileuploadadd: function(e) {
this.find('.ss-uploadfield-editandorganize').show(); this.find('.ss-uploadfield-editandorganize').show();
}, },
onfileuploadstart: function(e) { onfileuploadstart: function(e) {
this.find('.ss-uploadfield-editandorganize').show(); this.find('.ss-uploadfield-editandorganize').show();
} }
}); });
}(jQuery)); }(jQuery));

View File

@ -152,6 +152,9 @@
this._super(); this._super();
this.setUUID(new Date().getTime()); this.setUUID(new Date().getTime());
}, },
onunmatch: function() {
this._super();
},
onclick: function(e){ onclick: function(e){
var btn = this.closest(':button'), grid = this.getGridField(), var btn = this.closest(':button'), grid = this.getGridField(),
form = this.closest('form'), data = form.find(':input').serialize(); form = this.closest('form'), data = form.find(':input').serialize();
@ -172,12 +175,14 @@
$('.ss-gridfield-print-iframe').entwine({ $('.ss-gridfield-print-iframe').entwine({
onmatch: function(){ onmatch: function(){
this.hide().bind('load', function() this.hide().bind('load', function() {
{
this.focus(); this.focus();
var ifWin = this.contentWindow || this; var ifWin = this.contentWindow || this;
ifWin.print(); ifWin.print();
});; });;
},
onunmatch: function() {
this._super();
} }
}); });
@ -247,7 +252,7 @@
* rather than the whole form. * rather than the whole form.
*/ */
$('.ss-gridfield .filter-header :input').entwine({ $('.ss-gridfield .filter-header :input').entwine({
onmatch: function(){ onmatch: function() {
var filterbtn = this.closest('.fieldgroup').find('.ss-gridfield-button-filter'), var filterbtn = this.closest('.fieldgroup').find('.ss-gridfield-button-filter'),
resetbtn = this.closest('.fieldgroup').find('.ss-gridfield-button-reset'); resetbtn = this.closest('.fieldgroup').find('.ss-gridfield-button-reset');
@ -257,6 +262,9 @@
} }
this._super(); this._super();
}, },
onunmatch: function() {
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
if(this.closest('.ss-gridfield-button-reset').length) return; if(this.closest('.ss-gridfield-button-reset').length) return;

View File

@ -230,7 +230,12 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
this._super(); this._super();
}, },
onunmatch: function() {
// TODO Throws exceptions in Firefox, most likely due to the element being removed from the DOM at this point
// var ed = tinyMCE.get(this.attr('id'));
// if(ed) ed.remove();
this._super();
},
redraw: function() { redraw: function() {
// Using a global config (generated through HTMLEditorConfig PHP logic) // Using a global config (generated through HTMLEditorConfig PHP logic)
var config = ssTinyMceConfig, self = this, ed = this.getEditor(); var config = ssTinyMceConfig, self = this, ed = this.getEditor();
@ -274,11 +279,11 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
this.openDialog('link'); this.openDialog('link');
}, },
openMediaDialog: function() { openMediaDialog: function() {
this.openDialog('media'); this.openDialog('media');
}, },
openDialog: function(type) { openDialog: function(type) {
var capitalize = function(text) { var capitalize = function(text) {
return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase(); return text.charAt(0).toUpperCase() + text.slice(1).toLowerCase();
}; };
var url = $('#cms-editor-dialogs').data('url' + capitalize(type) + 'form'), var url = $('#cms-editor-dialogs').data('url' + capitalize(type) + 'form'),
@ -298,13 +303,6 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
} }
}); });
} }
},
onunmatch: function() {
// TODO Throws exceptions in Firefox, most likely due to the element being removed from the DOM at this point
// var ed = tinyMCE.get(this.attr('id'));
// if(ed) ed.remove();
this._super();
} }
}); });
@ -315,6 +313,9 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
getForm: function() { getForm: function() {
return this.find('form'); return this.find('form');
}, },
@ -358,6 +359,9 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
this.redraw(); this.redraw();
}, },
onunmatch: function() {
this._super();
},
redraw: function() { redraw: function() {
}, },
resetFields: function() { resetFields: function() {
@ -992,6 +996,9 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
if(this.attr('name') == 'Width') this.closest('.ss-htmleditorfield-file').updateDimensions('Width', 600); if(this.attr('name') == 'Width') this.closest('.ss-htmleditorfield-file').updateDimensions('Width', 600);
}, },
onunmatch: function() {
this._super();
},
onfocusout: function(e) { onfocusout: function(e) {
this.closest('.ss-htmleditorfield-file').updateDimensions(this.attr('name')); this.closest('.ss-htmleditorfield-file').updateDimensions(this.attr('name'));
} }
@ -1021,6 +1028,9 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE;
fileList.setState('ParentID', self.getValue()); fileList.setState('ParentID', self.getValue());
fileList.reload(); fileList.reload();
}); });
},
onunmatch: function() {
this._super();
} }
}); });

View File

@ -13,6 +13,9 @@
this.toggleCheckboxes(); this.toggleCheckboxes();
}, },
onunmatch: function() {
this._super();
},
onclick: function(e) { onclick: function(e) {
this.toggleCheckboxes(); this.toggleCheckboxes();
}, },
@ -62,6 +65,9 @@
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
onclick: function(e) { onclick: function(e) {
var checkboxes = this.getCheckboxesExceptThisOne(); var checkboxes = this.getCheckboxesExceptThisOne();
if($(this).is(':checked')) { if($(this).is(':checked')) {
@ -79,4 +85,4 @@
}); });
}); });
}(jQuery)); }(jQuery));

View File

@ -12,7 +12,6 @@
onunmatch: function() { onunmatch: function() {
this._super(); this._super();
}, },
redrawTabs: function() { redrawTabs: function() {
this.rewriteHashlinks(); this.rewriteHashlinks();
this.tabs(); this.tabs();

View File

@ -29,7 +29,7 @@
* @todo Expand title height to fit all elements * @todo Expand title height to fit all elements
*/ */
$('.TreeDropdownField').entwine({ $('.TreeDropdownField').entwine({
onmatch: function() { onmatch: function() {
this.append( this.append(
'<span class="treedropdownfield-title"></span>' + '<span class="treedropdownfield-title"></span>' +
'<div class="treedropdownfield-toggle-panel-link"><a href="#" class="ui-icon ui-icon-triangle-1-s"></a></div>' + '<div class="treedropdownfield-toggle-panel-link"><a href="#" class="ui-icon ui-icon-triangle-1-s"></a></div>' +
@ -44,6 +44,9 @@
this.getPanel().hide(); this.getPanel().hide();
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
getPanel: function() { getPanel: function() {
return this.find('.treedropdownfield-panel'); return this.find('.treedropdownfield-panel');
}, },
@ -268,6 +271,9 @@
this.setTitle(title ? title : strings.searchFieldTitle); this.setTitle(title ? title : strings.searchFieldTitle);
}, },
onunmatch: function() {
this._super();
},
setTitle: function(title) { setTitle: function(title) {
if(!title && title !== '') title = strings.fieldTitle; if(!title && title !== '') title = strings.fieldTitle;

View File

@ -160,7 +160,9 @@
this._super(); this._super();
}, },
onunmatch: function() {
this._super();
},
openSelectDialog: function() { openSelectDialog: function() {
// Create dialog and load iframe // Create dialog and load iframe
var self = this, config = this.getConfig(), dialogId = 'ss-uploadfield-dialog-' + this.attr('id'), dialog = jQuery('#' + dialogId); var self = this, config = this.getConfig(), dialogId = 'ss-uploadfield-dialog-' + this.attr('id'), dialog = jQuery('#' + dialogId);
@ -387,6 +389,9 @@
$(this).parent().removeClass('loading'); $(this).parent().removeClass('loading');
}); });
this._super(); this._super();
},
onunmatch: function() {
this._super();
} }
}); });
$('div.ss-upload .ss-uploadfield-fromfiles').entwine({ $('div.ss-upload .ss-uploadfield-fromfiles').entwine({

View File

@ -12,6 +12,9 @@
fileList.setState('ParentID', self.getValue()); fileList.setState('ParentID', self.getValue());
fileList.reload(); fileList.reload();
}); });
},
onunmatch: function() {
this._super();
} }
}); });
}); });