X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fmenubutton%2Fplugin.js;h=1bb6599ca3d11c20fb1df3d26a4c0c691cb3dbdc;hb=2f22c0c38f17e75be5541089076885442aaa2377;hp=4797a4eb63b9094f0e6468a98985127385012468;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/_source/plugins/menubutton/plugin.js b/_source/plugins/menubutton/plugin.js index 4797a4e..1bb6599 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-2012, 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 )