JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.5.1
[ckeditor.git] / _source / plugins / richcombo / plugin.js
index 76523bc..7978abe 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
 For licensing, see LICENSE.html or http://ckeditor.com/license\r
 */\r
 \r
@@ -106,8 +106,7 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
                                                return;\r
                                        }\r
 \r
-                                       !_.committed && this.commit();\r
-\r
+                                       this.commit();\r
                                        var value = this.getValue();\r
                                        if ( value )\r
                                                _.list.mark( value );\r
@@ -132,6 +131,7 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
                        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
 \r
@@ -197,7 +197,7 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
                                                '<span>' +\r
                                                        '<span id="' + id + '_text" class="cke_text cke_inline_label">' + this.label + '</span>' +\r
                                                '</span>' +\r
-                                               '<span class=cke_openbutton>' + ( CKEDITOR.env.hc ? '<span>&#9660;</span>' : '' ) + '</span>' + // BLACK DOWN-POINTING TRIANGLE\r
+                                               '<span class=cke_openbutton>' + ( CKEDITOR.env.hc ? '<span>&#9660;</span>' : CKEDITOR.env.air ?  '&nbsp;' : '' ) + '</span>' +  // BLACK DOWN-POINTING TRIANGLE\r
                                        '</a>' +\r
                                '</span>' +\r
                                '</span>' );\r
@@ -290,16 +290,18 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
                        this._.value = value;\r
 \r
                        var textElement = this.document.getById( 'cke_' + this.id + '_text' );\r
-\r
-                       if ( !( value || text ) )\r
+                       if ( textElement )\r
                        {\r
-                               text = this.label;\r
-                               textElement.addClass( 'cke_inline_label' );\r
-                       }\r
-                       else\r
-                               textElement.removeClass( 'cke_inline_label' );\r
+                               if ( !( value || text ) )\r
+                               {\r
+                                       text = this.label;\r
+                                       textElement.addClass( 'cke_inline_label' );\r
+                               }\r
+                               else\r
+                                       textElement.removeClass( 'cke_inline_label' );\r
 \r
-                       textElement.setHtml( typeof text != 'undefined' ? text : value );\r
+                               textElement.setHtml( typeof text != 'undefined' ? text : value );\r
+                       }\r
                },\r
 \r
                getValue : function()\r
@@ -345,7 +347,12 @@ CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass(
 \r
                commit : function()\r
                {\r
-                       this._.list.commit();\r
+                       if ( !this._.committed )\r
+                       {\r
+                               this._.list.commit();\r
+                               this._.committed = 1;\r
+                               CKEDITOR.ui.fire( 'ready', this );\r
+                       }\r
                        this._.committed = 1;\r
                },\r
 \r