Skip to main content

Buttons

To process buttons which are specified in the plugin variations (not in the modal windows / panels), use the button method. This function is called when any of the plugin buttons is clicked.

Parameters​

NameTypeDescription
idnumberThe button index in the buttons array of the config.json file. If id == -1, then the plugin considers that the Close window cross button has been clicked or its operation has been somehow interrupted.
windowIdnumberAn index of the button from the modal window.

Example​

Asc.plugin.button = (id, windowId) => {
if (!windowId) {
return;
}

if (windowId === newWindow.id) {
console.log("Plugin button");
}
};