X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fmenubutton%2Fplugin.js;h=414edac782b166c0847c4dae435932ff13393c5a;hb=3fe9cac293e090ea459a3ee10d78cbe9e1dd0e03;hp=bd98f7953d40ddefb533c69a08dc8b2e8383c886;hpb=e7789c1ad838194d45eeee6ac2eb6e55f5cf35a1;p=ckeditor.git diff --git a/_source/plugins/menubutton/plugin.js b/_source/plugins/menubutton/plugin.js index bd98f79..414edac 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-2013, 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,20 +35,24 @@ CKEDITOR.UI_MENUBUTTON = 5; var menu = _.menu; if ( !menu ) { - menu = _.menu = new CKEDITOR.plugins.contextMenu( editor ); - menu.definition.panel.attributes[ 'aria-label' ] = editor.lang.common.options; + 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 )