javascript - Dropdown toolbar button for CKEditor 4 -


is possible create drop down style menu consisting of toolbar buttons?

i want have button on toolbar groups alignment buttons (and possibly others) drop down menu.

thanks

the problem not hard still got write couple lines of code. following logic inside pluginsloaded can (should) defined in init of totally new plugin (which called "groupped-justify"). otherwise, if executed late, e.g. after toolbar generated, whole code makes no sense.

see official plugin development guide know more.

also see jsfiddle working example.

ckeditor.replace( 'editor', {     plugins: 'wysiwygarea,sourcearea,basicstyles,toolbar,menu,menubutton,justify',     on: {         pluginsloaded: function() {             var editor = this,                 items = {};              editor.addmenugroup( 'some_group' );              items.justifyleft = {                 label: editor.lang.justify.left,                 group: 'some_group',                 command: 'justifyleft',                 order: 1             };              items.justifyright = {                 label: editor.lang.justify.right,                 group: 'some_group',                 command: 'justifyright',                 order: 2             };              editor.addmenuitems( items );              editor.ui.add( 'groupped', ckeditor.ui_menubutton, {                 label: 'groupped justify',                 // disable in source mode.                 modes: {                      wysiwyg: 1                  },                 icon: 'justifyleft',                 onmenu: function() {                     var active = {};                      // make items active.                     ( var p in items )                         active[ p ] = ckeditor.tristate_off;                      return active;                 }             } );                                }     } } ); 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -