X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fliststyle%2Fplugin.js;h=b1b6df3bab31e9f42ce380e39635673ccb904961;hb=055b6b0792ce7dc53d47af606b367c04b927c2ab;hp=e63905f2014ddb978a2ac76e3de880b2588fca6e;hpb=8665a7c6c60586526e32e8941fe2896739b6ebfb;p=ckeditor.git diff --git a/_source/plugins/liststyle/plugin.js b/_source/plugins/liststyle/plugin.js index e63905f..b1b6df3 100644 --- a/_source/plugins/liststyle/plugin.js +++ b/_source/plugins/liststyle/plugin.js @@ -7,19 +7,20 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { CKEDITOR.plugins.liststyle = { + requires : [ 'dialog' ], init : function( editor ) { - editor.addCommand( 'numberedListStyle', new CKEDITOR.dialogCommand( 'numberedListStyle' ) ); CKEDITOR.dialog.add( 'numberedListStyle', this.path + 'dialogs/liststyle.js' ); editor.addCommand( 'bulletedListStyle', new CKEDITOR.dialogCommand( 'bulletedListStyle' ) ); CKEDITOR.dialog.add( 'bulletedListStyle', this.path + 'dialogs/liststyle.js' ); - //Register map group; - editor.addMenuGroup("list", 108); // If the "menu" plugin is loaded, register the menu items. if ( editor.addMenuItems ) { + //Register map group; + editor.addMenuGroup("list", 108); + editor.addMenuItems( { numberedlist : @@ -42,14 +43,17 @@ For licensing, see LICENSE.html or http://ckeditor.com/license { editor.contextMenu.addListener( function( element, selection ) { - if ( !element ) - return null; - - if ( element.getAscendant( 'ol') ) - return { numberedlist: CKEDITOR.TRISTATE_OFF }; + while ( element ) + { + var name = element.getName(); + if ( name == 'ol' ) + return { numberedlist: CKEDITOR.TRISTATE_OFF }; + else if ( name == 'ul' ) + return { bulletedlist: CKEDITOR.TRISTATE_OFF }; - if ( element.getAscendant( 'ul' ) ) - return { bulletedlist: CKEDITOR.TRISTATE_OFF }; + element = element.getParent(); + } + return null; }); } }