You are not logged in.
Pages: 1
Hi,
Is it possible to add buttons to toolbar on the fly ?
I have a plugin with 10 buttons but I don't want to have always these buttons, so I created only one button and when I click on it, it add all other buttons to toolbar and call _createToolbar().
But I have 2 problems:
- the new toolbar works well but appears at the bottom of the editor, so I have 2 toolbars.
- removeToolbarElement() don't work as expected (but it's not so important)
I didn't see any _replaceToolbar(), so how I can replace the toolbar with my new one ?
cfg.registerButton({
id : "morebuttons",
tooltip : this._lc("More buttons"),
image : _editor_url+"plugins/myplugin/img/morebuttons.gif",
textMode : false,
action : function(editor) {
cfg.registerButton({
id : "button1",
tooltip : self._lc("Button 1"),
image : _editor_url+"plugins/myplugin/img/button1.gif",
textMode : false,
action : function(editor) {
alert("OK")
}
})
cfg.removeToolbarElement("morebuttons");
cfg.addToolbarElement("button1", "morebuttons", 1);
editor._createToolbar();
}
})
Offline
Pages: 1