Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
ckeditor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vanilla ckeditor-3.4.3
[ckeditor.git]
/
_source
/
plugins
/
button
/
plugin.js
diff --git
a/_source/plugins/button/plugin.js
b/_source/plugins/button/plugin.js
index
305a6f9
..
c0c8208
100644
(file)
--- a/
_source/plugins/button/plugin.js
+++ b/
_source/plugins/button/plugin.js
@@
-98,11
+98,22
@@
CKEDITOR.ui.button.prototype =
\r
instance.index = index = CKEDITOR.ui.button._.instances.push( instance ) - 1;
\r
\r
\r
instance.index = index = CKEDITOR.ui.button._.instances.push( instance ) - 1;
\r
\r
+ // Indicate a mode sensitive button.
\r
if ( this.modes )
\r
{
\r
if ( this.modes )
\r
{
\r
+ var modeStates = {};
\r
+ editor.on( 'beforeModeUnload', function()
\r
+ {
\r
+ modeStates[ editor.mode ] = this._.state;
\r
+ }, this );
\r
+
\r
editor.on( 'mode', function()
\r
{
\r
editor.on( 'mode', function()
\r
{
\r
- this.setState( this.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
\r
+ var mode = editor.mode;
\r
+ // Restore saved button state.
\r
+ this.setState( this.modes[ mode ] ?
\r
+ modeStates[ mode ] != undefined ? modeStates[ mode ] :
\r
+ CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
\r
}, this);
\r
}
\r
else if ( command )
\r
}, this);
\r
}
\r
else if ( command )
\r