X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Frichcombo%2Fplugin.js;h=f79c1b31cc24f4534109e85a6391498808988f7d;hb=4e70ea24db840898be8cc21c950363a52a2a6aba;hp=8974fca06a7e74859d960ae77117a35d4ed70e9d;hpb=4e90e78dc97789709ee7404359a5517540c27553;p=ckeditor.git diff --git a/_source/plugins/richcombo/plugin.js b/_source/plugins/richcombo/plugin.js index 8974fca..f79c1b3 100644 --- a/_source/plugins/richcombo/plugin.js +++ b/_source/plugins/richcombo/plugin.js @@ -18,7 +18,7 @@ CKEDITOR.plugins.add( 'richcombo', * @constant * @example */ -CKEDITOR.UI_RICHCOMBO = 3; +CKEDITOR.UI_RICHCOMBO = 'richcombo'; CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( { @@ -128,12 +128,16 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( clickFn : clickFn }; - editor.on( 'mode', function() - { - this.setState( this.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED ); - this.setValue( '' ); - }, - this ); + function updateState() + { + var state = this.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED; + this.setState( editor.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : state ); + this.setValue( '' ); + } + + editor.on( 'mode', updateState, this ); + // If this combo is sensitive to readOnly state, update it accordingly. + !this.readOnly && editor.on( 'readOnly', updateState, this); var keyDownFn = CKEDITOR.tools.addFunction( function( ev, element ) { @@ -161,14 +165,14 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( instance.keyDownFn = keyDownFn; output.push( - '', + '', '', + ' role="presentation">', '', this.label, '', '= 10900 && !env.hc ? '' : ' href="javascript:void(\'' + this.label + '\')"',