Permalink
Browse files

Remove "changed" style from buttons if fields are reset

  • Loading branch information...
1 parent 8dd9bf3 commit 6cb77108f5c5c03b81b4193642a8a456021b6380 @chillu chillu committed Dec 17, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 javascript/CMSMain.EditForm.js
@@ -314,14 +314,15 @@
* Enable save buttons upon detecting changes to content.
* "changed" class is added by jQuery.changetracker.
*/
- $('.cms-edit-form .changed').entwine({
+ $('.cms-edit-form.changed').entwine({
onmatch: function(e) {
- var form = this.closest('.cms-edit-form');
- form.find('button[name=action_save]').button('option', 'showingAlternate', true);
- form.find('button[name=action_publish]').button('option', 'showingAlternate', true);
+ this.find('button[name=action_save]').button('option', 'showingAlternate', true);
+ this.find('button[name=action_publish]').button('option', 'showingAlternate', true);
this._super(e);
},
onunmatch: function(e) {
+ this.find('button[name=action_save]').button('option', 'showingAlternate', false);
+ this.find('button[name=action_publish]').button('option', 'showingAlternate', false);
this._super(e);
}
});

0 comments on commit 6cb7710

Please sign in to comment.