JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6
[ckeditor.git] / _source / plugins / menu / plugin.js
index 5d37ffd..731fed4 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
@@ -49,7 +49,7 @@ CKEDITOR.plugins.add( 'menu',
                $ : function( editor, definition )\r
                {\r
                        definition = this._.definition = definition || {};\r
-                       this.id = 'cke_' + CKEDITOR.tools.getNextNumber();\r
+                       this.id = CKEDITOR.tools.getNextId();\r
 \r
                        this.editor = editor;\r
                        this.items = [];\r
@@ -97,7 +97,7 @@ CKEDITOR.plugins.add( 'menu',
                                                {\r
                                                        var item = this.editor.getMenuItem( itemName );\r
 \r
-                                                       if ( item )\r
+                                                       if ( item && ( !item.command || this.editor.getCommand( item.command ).state ) )\r
                                                        {\r
                                                                item.state = listenerItems[ itemName ];\r
                                                                this.add( item );\r
@@ -411,7 +411,7 @@ CKEDITOR.plugins.add( 'menu',
                        var hasSubMenu = this.getItems;\r
 \r
                        output.push(\r
-                               '<span class="cke_menuitem">' +\r
+                               '<span class="cke_menuitem' + ( this.icon && this.icon.indexOf( '.png' ) == -1 ? ' cke_noalphafix' : '' ) + '">' +\r
                                '<a id="', id, '"' +\r
                                        ' class="', classes, '" href="javascript:void(\'', ( this.label || '' ).replace( "'", '' ), '\')"' +\r
                                        ' title="', this.label, '"' +\r