* @constant\r
* @example\r
*/\r
-CKEDITOR.UI_RICHCOMBO = 3;\r
+CKEDITOR.UI_RICHCOMBO = 'richcombo';\r
\r
CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(\r
{\r
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
ev.preventDefault();\r
});\r
\r
+ var focusFn = CKEDITOR.tools.addFunction( function() { instance.onfocus && instance.onfocus(); } );\r
+\r
// For clean up\r
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
\r
output.push(\r
' onkeydown="CKEDITOR.tools.callFunction( ', keyDownFn, ', event, this );"' +\r
- ' onclick="CKEDITOR.tools.callFunction(', clickFn, ', this); return false;">' +\r
+ ' onfocus="return CKEDITOR.tools.callFunction(', focusFn, ', event);" ' +\r
+ ( CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : 'onclick' ) + // #188\r
+ '="CKEDITOR.tools.callFunction(', clickFn, ', this); return false;">' +\r
'<span>' +\r
'<span id="' + id + '_text" class="cke_text cke_inline_label">' + this.label + '</span>' +\r
'</span>' +\r
panel.onEscape = function()\r
{\r
panel.hide();\r
- me.document.getById( 'cke_' + me.id ).getFirst().getNext().focus();\r
};\r
\r
list.onClick = function( value, marked )\r
else\r
me.setValue( '' );\r
\r
- panel.hide();\r
+ panel.hide( false );\r
};\r
\r
this._.panel = panel;\r