JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6
[ckeditor.git] / _source / plugins / richcombo / plugin.js
index 8974fca..f79c1b3 100644 (file)
@@ -18,7 +18,7 @@ CKEDITOR.plugins.add( 'richcombo',
  * @constant\r
  * @example\r
  */\r
-CKEDITOR.UI_RICHCOMBO = 3;\r
+CKEDITOR.UI_RICHCOMBO = 'richcombo';\r
 \r
 CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(\r
 {\r
@@ -128,12 +128,16 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
                                clickFn : clickFn\r
                        };\r
 \r
-                       editor.on( 'mode', function()\r
-                               {\r
-                                       this.setState( this.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );\r
-                                       this.setValue( '' );\r
-                               },\r
-                               this );\r
+                       function updateState()\r
+                       {\r
+                               var state = this.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;\r
+                               this.setState( editor.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : state );\r
+                               this.setValue( '' );\r
+                       }\r
+\r
+                       editor.on( 'mode', updateState, this );\r
+                       // If this combo is sensitive to readOnly state, update it accordingly.\r
+                       !this.readOnly && editor.on( 'readOnly', updateState, this);\r
 \r
                        var keyDownFn = CKEDITOR.tools.addFunction( function( ev, element )\r
                                {\r
@@ -161,14 +165,14 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
                        instance.keyDownFn = keyDownFn;\r
 \r
                        output.push(\r
-                               '<span class="cke_rcombo">',\r
+                               '<span class="cke_rcombo" role="presentation">',\r
                                '<span id=', id );\r
 \r
                        if ( this.className )\r
                                output.push( ' class="', this.className, ' cke_off"');\r
 \r
                        output.push(\r
-                               '>',\r
+                               ' role="presentation">',\r
                                        '<span id="' + id+ '_label" class=cke_label>', this.label, '</span>',\r
                                        '<a hidefocus=true title="', this.title, '" tabindex="-1"',\r
                                                env.gecko && env.version >= 10900 && !env.hc ? '' : ' href="javascript:void(\'' + this.label + '\')"',\r