/*\r
-Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
{\r
CKEDITOR.plugins.liststyle =\r
{\r
+ requires : [ 'dialog' ],\r
init : function( editor )\r
{\r
-\r
editor.addCommand( 'numberedListStyle', new CKEDITOR.dialogCommand( 'numberedListStyle' ) );\r
CKEDITOR.dialog.add( 'numberedListStyle', this.path + 'dialogs/liststyle.js' );\r
editor.addCommand( 'bulletedListStyle', new CKEDITOR.dialogCommand( 'bulletedListStyle' ) );\r
CKEDITOR.dialog.add( 'bulletedListStyle', this.path + 'dialogs/liststyle.js' );\r
\r
- //Register map group;\r
- editor.addMenuGroup("list", 108);\r
// If the "menu" plugin is loaded, register the menu items.\r
if ( editor.addMenuItems )\r
{\r
+ //Register map group;\r
+ editor.addMenuGroup("list", 108);\r
+\r
editor.addMenuItems(\r
{\r
numberedlist :\r
{\r
editor.contextMenu.addListener( function( element, selection )\r
{\r
- if ( !element )\r
+ if ( !element || element.isReadOnly() )\r
return null;\r
\r
- if ( element.getAscendant( 'ol') )\r
- return { numberedlist: CKEDITOR.TRISTATE_OFF };\r
+ while ( element )\r
+ {\r
+ var name = element.getName();\r
+ if ( name == 'ol' )\r
+ return { numberedlist: CKEDITOR.TRISTATE_OFF };\r
+ else if ( name == 'ul' )\r
+ return { bulletedlist: CKEDITOR.TRISTATE_OFF };\r
\r
- if ( element.getAscendant( 'ul' ) )\r
- return { bulletedlist: CKEDITOR.TRISTATE_OFF };\r
+ element = element.getParent();\r
+ }\r
+ return null;\r
});\r
}\r
}\r