X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fmenubutton%2Fplugin.js;h=6f0753179740fae46a600915e5666fa49c2bb778;hb=4e70ea24db840898be8cc21c950363a52a2a6aba;hp=4797a4eb63b9094f0e6468a98985127385012468;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/_source/plugins/menubutton/plugin.js b/_source/plugins/menubutton/plugin.js index 4797a4e..6f07531 100644 --- a/_source/plugins/menubutton/plugin.js +++ b/_source/plugins/menubutton/plugin.js @@ -1,11 +1,11 @@ /* -Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ CKEDITOR.plugins.add( 'menubutton', { - requires : [ 'button', 'contextmenu' ], + requires : [ 'button', 'menu' ], beforeInit : function( editor ) { editor.ui.addHandler( CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler ); @@ -17,7 +17,7 @@ CKEDITOR.plugins.add( 'menubutton', * @constant * @example */ -CKEDITOR.UI_MENUBUTTON = 5; +CKEDITOR.UI_MENUBUTTON = 'menubutton'; (function() { @@ -35,19 +35,24 @@ CKEDITOR.UI_MENUBUTTON = 5; var menu = _.menu; if ( !menu ) { - menu = _.menu = new CKEDITOR.plugins.contextMenu( editor ); + menu = _.menu = new CKEDITOR.menu( editor, + { + panel: + { + className : editor.skinClass + ' cke_contextmenu', + attributes : { 'aria-label' : editor.lang.common.options } + } + }); menu.onHide = CKEDITOR.tools.bind( function() { - this.setState( _.previousState ); + this.setState( this.modes && this.modes[ editor.mode ] ? _.previousState : CKEDITOR.TRISTATE_DISABLED ); }, this ); // Initialize the menu items at this point. if ( this.onMenu ) - { menu.addListener( this.onMenu ); - } } if ( _.on )