summaryrefslogtreecommitdiff
path: root/doc/api/editbar.md
blob: ce89c0b7c0bb0c353b1113ace04e4ab1fefcbb3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Editbar
srf/static/js/pad_editbar.js

## 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)
Creates an ace callstack and calls the callback with an ace instance: `callback(cmd, ace)`.

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])
Triggers a command (optionally with some internal representation of the toolbar item that triggered it).