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
idnumberDefines the 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.
windowIdnumberDefines an 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")
  }
}

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).