new UIButton(isActive, svgIcon)
Creates an instance of UIButton.
| Name | Type | Default | Description |
|---|---|---|---|
isActive |
boolean | false |
Determines if the button is active (default is false). |
svgIcon |
string |
The SVG icon to display on the button. |
Methods
-
createTooltip(title)
UIMap/UIDisplay/UIButton/index.ts, line 93 -
Creates tooltip to the button.
Name Type Description titlestring The tooltip text to display when the user hovers over the button, don't use with setTitle
-
getSVG(){string}
UIMap/UIDisplay/UIButton/index.ts, line 54 -
Gets the SVG icon of the button.
Returns:
Type Description string The SVG icon string of the button. -
hasTooltip()
UIMap/UIDisplay/UIButton/index.ts, line 114 -
Return true if Button has tooltip, false in other case.
-
refreshTitleTranlations()
UIMap/UIDisplay/UIButton/index.ts, line 157 -
Updates the translated title and tooltip of the button.
-
removeTitle()
UIMap/UIDisplay/UIButton/index.ts, line 82 -
Removes the title from the button.
-
removeTooltip()
UIMap/UIDisplay/UIButton/index.ts, line 104 -
Remove tooltip from the button.
-
setClassName(className)
UIMap/UIDisplay/UIButton/index.ts, line 123 -
Sets the title of the button.
Name Type Description classNamestring The tooltip text to display when the user hovers over the button.
-
setOnClick(callback)
UIMap/UIDisplay/UIButton/index.ts, line 63 -
Sets the callback function that will be triggered when the button is clicked.
Name Type Description callbackfunction The function to execute on button click.
-
setSVG(){void}
UIMap/UIDisplay/UIButton/index.ts, line 45 -
Sets the SVG icon of the button.
Returns:
Type Description void -
setTitle(title)
UIMap/UIDisplay/UIButton/index.ts, line 72 -
Sets the title of the button.
Name Type Description titlestring The tooltip text to display when the user hovers over the button.
-
showIfActive(container)
UIMap/UIDisplay/UIButton/index.ts, line 140 -
Displays the button in the specified container if the button is active. Adds an event listener for the button's click event that triggers the assigned callback function.
Name Type Description containerHTMLElement The container element to append the button to.
