2014-03-16 15:43:38 +01:00
|
|
|
# Editbar
|
2017-03-12 04:09:49 +01:00
|
|
|
src/static/js/pad_editbar.js
|
2014-03-16 15:43:38 +01:00
|
|
|
|
|
|
|
## isEnabled()
|
|
|
|
|
|
|
|
## disable()
|
|
|
|
|
|
|
|
## toggleDropDown(dropdown, callback)
|
|
|
|
Shows the dropdown `div.popup` whose `id` equals `dropdown`.
|
|
|
|
|
|
|
|
## registerCommand(cmd, callback)
|
|
|
|
Register a handler for a specific command. Commands are fired if the corresponding button is clicked or the corresponding select is changed.
|
|
|
|
|
|
|
|
## registerAceCommand(cmd, callback)
|
2016-03-18 20:11:29 +01:00
|
|
|
Creates an ace callstack and calls the callback with an ace instance (and a toolbar item, if applicable): `callback(cmd, ace, item)`.
|
2014-03-16 15:43:38 +01:00
|
|
|
|
|
|
|
Example:
|
|
|
|
```
|
|
|
|
toolbar.registerAceCommand("insertorderedlist", function (cmd, ace) {
|
|
|
|
ace.ace_doInsertOrderedList();
|
|
|
|
});
|
|
|
|
```
|
|
|
|
|
|
|
|
## registerDropdownCommand(cmd, dropdown)
|
|
|
|
Ties a `div.popup` where `id` equals `dropdown` to a `command` fired by clicking a button.
|
|
|
|
|
|
|
|
## triggerCommand(cmd[, item])
|
2017-03-12 04:09:49 +01:00
|
|
|
Triggers a command (optionally with some internal representation of the toolbar item that triggered it).
|