/*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
{\r
var menu = this._.subMenu,\r
item = this.items[ index ],\r
- subItems = item.getItems && item.getItems();\r
+ subItemDefs = item.getItems && item.getItems();\r
\r
// If this item has no subitems, we just hide the submenu, if\r
// available, and return back.\r
- if ( !subItems )\r
+ if ( !subItemDefs )\r
{\r
this._.panel.hideChild();\r
return;\r
}\r
\r
// Add all submenu items to the menu.\r
- for ( var itemName in subItems )\r
+ for ( var subItemName in subItemDefs )\r
{\r
- menu.add( this.editor.getMenuItem( itemName ) );\r
+ var subItem = this.editor.getMenuItem( subItemName );\r
+ if ( subItem )\r
+ {\r
+ subItem.state = subItemDefs[ subItemName ];\r
+ menu.add( subItem );\r
+ }\r
}\r
\r
// Get the element representing the current item.\r
{\r
panel = this._.panel = new CKEDITOR.ui.floatPanel( this.editor, CKEDITOR.document.getBody(),\r
{\r
- css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ],\r
+ css : editor.skin.editor.css,\r
level : this._.level - 1,\r
className : editor.skinClass + ' cke_contextmenu'\r
},\r
this.parent._.panel.showAsChild( panel, this.id, offsetParent, corner, offsetX, offsetY );\r
else\r
panel.showBlock( this.id, offsetParent, corner, offsetX, offsetY );\r
+\r
+ editor.fire( 'menuShow', [ panel ] );\r
},\r
\r
hide : function()\r
' onclick="CKEDITOR.tools.callFunction(', menu._.itemClickFn, ',', index, '); return false;"' +\r
'>' +\r
'<span class="cke_icon_wrapper"><span class="cke_icon"' +\r
- ( this.icon ? ' style="background-image:url(' + CKEDITOR.getUrl( this.icon ) + ');background-position:0 ' + offset + 'px;"></span>'\r
+ ( this.icon ? ' style="background-image:url(' + CKEDITOR.getUrl( this.icon ) + ');background-position:0 ' + offset + 'px;"'\r
: '' ) +\r
'></span></span>' +\r
'<span class="cke_label">' );\r
'form,' +\r
'tablecell,tablecellproperties,tablerow,tablecolumn,table,'+\r
'anchor,link,image,flash,' +\r
- 'checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea';\r
+ 'checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';\r