Toolbar

Toolbar

new Toolbar(options, target)

Description:
  • Toolbar instance constructor
Source:
Parameters:
Name Type Description
options Object Options object
target DOMElement The parent element.

Methods

add(name, widget)

Description:
  • Add custom clickable actions to the toolbar
Source:
Example
aladin.getToolbar()
      .add('action_custom', {
          icon: {
             url: yourIconUrl,
              size: "medium"
          },
          action(_) {
              console.log("do a thing")
          }
      });
Parameters:
Name Type Description
name string A name identifier for your new action
widget Object Your clickable action, same as for defining an action button
Properties
Name Type Attributes Default Description
toggled boolean <optional>
false Whether the button is initially toggled.
action function <optional>
The callback function to execute when the button is clicked.
title string <optional>
The title attribute for the button.
icon Object <optional>
An icon object for the button.
disabled boolean <optional>
false Whether the button is initially disabled.
cssStyle CSSStyleSheet <optional>
The CSS styles to apply to the button.
tooltip Object <optional>
A tooltip appearing when the user hovers the button.
size string <optional>
The size of the button. Can be 'medium' or 'small'