Documentation
Toolbar
get
name | String |
Gets the specified button from the toolbar.
var $button = this.app.toolbar.get('tune');
add
name | String | |
button | Object |
Adds a button to the toolbar.
(function() {
Revolvapp.add('plugin', 'myplugin', {
start: function() {
this.app.toolbar.add('mybutton', {
title: 'My Button',
icon: '<i class="fa fa-file-alt"></i>',
command: 'myplugin.toggle'
});
},
toggle: function(args) {
// do something
}
});
})(Revolvapp);
In this example, Font Awesome is used for the button icon. You can add your own HTML and SVG icon.
Now call the editor with the plugin created:
Revolvapp('#myemail', {
plugins: ['myplugin']
});
The button should appear on the toolbar when you click on any block and when it pressed, will call the plugin's toggle
method.
See more about the parameters of the buttons.
remove
name | String |
Removes the specified button from the toolbar.
this.app.toolbar.remove('tune');
disableButtons
except (optional) | Array |
Disables buttons on the toolbar except specified buttons.
this.app.toolbar.disableButtons(['mybutton']);
enableButtons
Enables all button on the toolbar.
this.app.toolbar.enableButtons();
dkjgvo65776inru43654