X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fmenu%2Fplugin.js;h=93ac77f085bc3c11bab1e1ed9f5af9c1df5a5866;hb=941b0a9ba4e673e292510d80a5a86806994b8ea6;hp=790f16f9be9ad4435e54e218e4e3535c4e693dad;hpb=ea7e3453c7b0f023b050aca6d9f83ab372860d91;p=ckeditor.git diff --git a/_source/plugins/menu/plugin.js b/_source/plugins/menu/plugin.js index 790f16f..93ac77f 100644 --- a/_source/plugins/menu/plugin.js +++ b/_source/plugins/menu/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -67,11 +67,11 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, { var menu = this._.subMenu, item = this.items[ index ], - subItems = item.getItems && item.getItems(); + subItemDefs = item.getItems && item.getItems(); // If this item has no subitems, we just hide the submenu, if // available, and return back. - if ( !subItems ) + if ( !subItemDefs ) { this._.panel.hideChild(); return; @@ -89,9 +89,14 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, } // Add all submenu items to the menu. - for ( var itemName in subItems ) + for ( var subItemName in subItemDefs ) { - menu.add( this.editor.getMenuItem( itemName ) ); + var subItem = this.editor.getMenuItem( subItemName ); + if ( subItem ) + { + subItem.state = subItemDefs[ subItemName ]; + menu.add( subItem ); + } } // Get the element representing the current item. @@ -132,7 +137,7 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, { panel = this._.panel = new CKEDITOR.ui.floatPanel( this.editor, CKEDITOR.document.getBody(), { - css : [ CKEDITOR.getUrl( editor.skinPath + 'editor.css' ) ], + css : editor.skin.editor.css, level : this._.level - 1, className : editor.skinClass + ' cke_contextmenu' }, @@ -232,6 +237,8 @@ CKEDITOR.tools.extend( CKEDITOR.editor.prototype, this.parent._.panel.showAsChild( panel, this.id, offsetParent, corner, offsetX, offsetY ); else panel.showBlock( this.id, offsetParent, corner, offsetX, offsetY ); + + editor.fire( 'menuShow', [ panel ] ); }, hide : function() @@ -328,7 +335,7 @@ CKEDITOR.menuItem = CKEDITOR.tools.createClass( ' onclick="CKEDITOR.tools.callFunction(', menu._.itemClickFn, ',', index, '); return false;"' + '>' + '' + ( this.icon ? ' style="background-image:url(' + CKEDITOR.getUrl( this.icon ) + ');background-position:0 ' + offset + 'px;"' : '' ) + '>' + '' ); @@ -374,4 +381,4 @@ CKEDITOR.config.menu_groups = 'form,' + 'tablecell,tablecellproperties,tablerow,tablecolumn,table,'+ 'anchor,link,image,flash,' + - 'checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea'; + 'checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div';