X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Frichcombo%2Fplugin.js;h=bcc5777bf28254ac34d52c6a4ba5e798ab3db206;hb=039a051ccf3901311661022a30afd60fc38130c9;hp=e93a351e2c509692c31595afc6ce4d49ea90e0c6;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/_source/plugins/richcombo/plugin.js b/_source/plugins/richcombo/plugin.js index e93a351..bcc5777 100644 --- a/_source/plugins/richcombo/plugin.js +++ b/_source/plugins/richcombo/plugin.js @@ -44,6 +44,11 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( || CKEDITOR.document; panelDefinition.className = ( panelDefinition.className || '' ) + ' cke_rcombopanel'; + panelDefinition.block = + { + multiSelect : panelDefinition.multiSelect, + attributes : panelDefinition.attributes + }; this._ = { @@ -83,6 +88,8 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( */ render : function( editor, output ) { + var env = CKEDITOR.env; + var id = 'cke_' + this.id; var clickFn = CKEDITOR.tools.addFunction( function( $element ) { @@ -123,7 +130,7 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( var element = CKEDITOR.document.getById( id ).getChild( 1 ); element.focus(); }, - execute : clickFn + clickFn : clickFn }; editor.on( 'mode', function() @@ -154,6 +161,9 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( ev.preventDefault(); }); + // For clean up + instance.keyDownFn = keyDownFn; + output.push( '', '' + - '', this.label, '' + - '', + '', this.label, '', + '= 10900 && !env.hc ? '' : ' href="javascript:void(\'' + this.label + '\')"', + ' role="button" aria-labelledby="', id , '_label" aria-describedby="', id, '_text" aria-haspopup="true"' ); // Some browsers don't cancel key events in the keydown but in the // keypress. @@ -187,10 +199,9 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( ' onkeydown="CKEDITOR.tools.callFunction( ', keyDownFn, ', event, this );"' + ' onclick="CKEDITOR.tools.callFunction(', clickFn, ', this); return false;">' + '' + - '' + ( this.voiceLabel ? this.voiceLabel + ' ' : '' ) + '' + '' + this.label + '' + '' + - '' + + '' + ( CKEDITOR.env.hc ? '' : '' ) + '' + // BLACK DOWN-POINTING TRIANGLE '' + '' + '' ); @@ -207,9 +218,10 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( return; var panelDefinition = this._.panelDefinition, + panelBlockDefinition = this._.panelDefinition.block, panelParentElement = panelDefinition.parent || CKEDITOR.document.getBody(), panel = new CKEDITOR.ui.floatPanel( editor, panelParentElement, panelDefinition ), - list = panel.addListBlock( this.id, this.multiSelect ), + list = panel.addListBlock( this.id, panelBlockDefinition ), me = this; panel.onShow = function() @@ -227,7 +239,7 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( me.onOpen(); }; - panel.onHide = function() + panel.onHide = function( preventOnClose ) { if ( me.className ) this.element.getFirst().removeClass( me.className + '_panel' ); @@ -236,7 +248,7 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( me._.on = 0; - if ( me.onClose ) + if ( !preventOnClose && me.onClose ) me.onClose(); }; @@ -290,6 +302,7 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass( } else textElement.removeClass( 'cke_inline_label' ); + textElement.setHtml( typeof text != 'undefined' ? text : value ); },