/*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
CKEDITOR.plugins.add( 'menubutton',\r
{\r
- requires : [ 'button', 'contextmenu' ],\r
+ requires : [ 'button', 'menu' ],\r
beforeInit : function( editor )\r
{\r
editor.ui.addHandler( CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler );\r
* @constant\r
* @example\r
*/\r
-CKEDITOR.UI_MENUBUTTON = 5;\r
+CKEDITOR.UI_MENUBUTTON = 'menubutton';\r
\r
(function()\r
{\r
var menu = _.menu;\r
if ( !menu )\r
{\r
- menu = _.menu = new CKEDITOR.plugins.contextMenu( editor );\r
- menu.definition.panel.attributes[ 'aria-label' ] = editor.lang.common.options;\r
+ menu = _.menu = new CKEDITOR.menu( editor,\r
+ {\r
+ panel:\r
+ {\r
+ className : editor.skinClass + ' cke_contextmenu',\r
+ attributes : { 'aria-label' : editor.lang.common.options }\r
+ }\r
+ });\r
\r
menu.onHide = CKEDITOR.tools.bind( function()\r
{\r
- this.setState( _.previousState );\r
+ this.setState( this.modes && this.modes[ editor.mode ] ? _.previousState : CKEDITOR.TRISTATE_DISABLED );\r
},\r
this );\r
\r
// Initialize the menu items at this point.\r
if ( this.onMenu )\r
- {\r
menu.addListener( this.onMenu );\r
- }\r
}\r
\r
if ( _.on )\r