Skip to content

Commit

Permalink
Avoid enabling commands like undo/redo when changing filter (calling …
Browse files Browse the repository at this point in the history
…cmd.refresh).
  • Loading branch information
Reinmar committed Sep 11, 2013
1 parent 7a1f9fc commit a195b2a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/command.js
Expand Up @@ -79,8 +79,9 @@ CKEDITOR.command = function( editor, commandDefinition ) {
return true;
}

// Make the "enabled" state as basis.
this.enable();
// Make the "enabled" state a default for commands enabled from start.
if ( !this.startDisabled )
this.enable();

if ( this.fire( 'refresh', { editor: editor, path: path } ) === false )
return true;
Expand Down
1 change: 1 addition & 0 deletions plugins/save/plugin.js
Expand Up @@ -10,6 +10,7 @@
(function() {
var saveCmd = {
readOnly: 1,
startDisabled: true,

exec: function( editor ) {
if ( editor.fire( 'save' ) ) {
Expand Down
2 changes: 2 additions & 0 deletions plugins/undo/plugin.js
Expand Up @@ -23,6 +23,7 @@
this.fire( 'afterUndo' );
}
},
startDisabled: true,
canUndo: false
} );

Expand All @@ -33,6 +34,7 @@
this.fire( 'afterRedo' );
}
},
startDisabled: true,
canUndo: false
} );

Expand Down

0 comments on commit a195b2a

Please sign in to comment.