Permalink
Browse files

BUGFIX Cleanup of onclick() being called in onmatch for ParentType

field. Use a redraw() function instead which is called in onmatch and
onclick
  • Loading branch information...
1 parent 614f307 commit 647d57809bfac36b7ca166cafde7c9ef83327c6e @halkyon halkyon committed Apr 23, 2012
Showing with 8 additions and 12 deletions.
  1. +8 −12 javascript/CMSMain.EditForm.js
@@ -276,20 +276,16 @@
*/
$('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({
onmatch: function() {
- this.onclick();
+ this.redraw();
this._super();
},
- /**
- * Function: onclick
- *
- * Parameters:
- * (Event) e
- */
- onclick: function(e) {
- var parentTreeDropDown = $('.cms-edit-form.CMSPageSettingsController #ParentID');
-
- if (e.target.id == 'Form_EditForm_ParentType_root') parentTreeDropDown.slideUp();
- else parentTreeDropDown.slideDown();
+ redraw: function() {
+ var treeField = $('.cms-edit-form.CMSPageSettingsController #ParentID');
+ if ($(this).attr('id') == 'Form_EditForm_ParentType_root') treeField.slideUp();
+ else treeField.slideDown();
+ },
+ onclick: function() {
+ this.redraw();
}
});

0 comments on commit 647d578

Please sign in to comment.