/*\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
$ : 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
{\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
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