X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Frichcombo%2Fplugin.js;h=8974fca06a7e74859d960ae77117a35d4ed70e9d;hb=refs%2Ftags%2Fv3.5.3;hp=710b946ebe99d92caf3a7fbd3a155fbbb6b7a014;hpb=e7789c1ad838194d45eeee6ac2eb6e55f5cf35a1;p=ckeditor.git
diff --git a/_source/plugins/richcombo/plugin.js b/_source/plugins/richcombo/plugin.js
index 710b946..8974fca 100644
--- a/_source/plugins/richcombo/plugin.js
+++ b/_source/plugins/richcombo/plugin.js
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
@@ -106,12 +106,7 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
return;
}
- if ( !_.committed )
- {
- _.list.commit();
- _.committed = 1;
- }
-
+ this.commit();
var value = this.getValue();
if ( value )
_.list.mark( value );
@@ -136,6 +131,7 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
editor.on( 'mode', function()
{
this.setState( this.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
+ this.setValue( '' );
},
this );
@@ -201,7 +197,7 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
'' +
'' + this.label + '' +
'' +
- '' + ( CKEDITOR.env.hc ? '▼' : '' ) + '' + // BLACK DOWN-POINTING TRIANGLE
+ '' + ( CKEDITOR.env.hc ? '▼' : CKEDITOR.env.air ? ' ' : '' ) + '' + // BLACK DOWN-POINTING TRIANGLE
'' +
'' +
'' );
@@ -239,16 +235,16 @@ 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' );
- me.setState( CKEDITOR.TRISTATE_OFF );
+ me.setState( me.modes && me.modes[ editor.mode ] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED );
me._.on = 0;
- if ( me.onClose )
+ if ( !preventOnClose && me.onClose )
me.onClose();
};
@@ -294,16 +290,18 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
this._.value = value;
var textElement = this.document.getById( 'cke_' + this.id + '_text' );
-
- if ( !( value || text ) )
+ if ( textElement )
{
- text = this.label;
- textElement.addClass( 'cke_inline_label' );
- }
- else
- textElement.removeClass( 'cke_inline_label' );
+ if ( !( value || text ) )
+ {
+ text = this.label;
+ textElement.addClass( 'cke_inline_label' );
+ }
+ else
+ textElement.removeClass( 'cke_inline_label' );
- textElement.setHtml( typeof text != 'undefined' ? text : value );
+ textElement.setHtml( typeof text != 'undefined' ? text : value );
+ }
},
getValue : function()
@@ -349,7 +347,13 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
commit : function()
{
- this._.list.commit();
+ if ( !this._.committed )
+ {
+ this._.list.commit();
+ this._.committed = 1;
+ CKEDITOR.ui.fire( 'ready', this );
+ }
+ this._.committed = 1;
},
setState : function( state )