Yurba Docs

METHOD createButton

Allows you to create a unique button on the top right panel

app.createButton(string ButtonName, string ButtonIcon, (name) => { ... })

ButtonName | Once created, the button will have its own unique name that cannot be given to other buttons. You can set properties and events for the button by this name

ButtonIcon | By default, you are required to specify the ion-icons icon code (along the lines of chatbubble-outline), but if you want to use other icons, here are examples:

bootstrap | Requires code to be specified as "bootstrap:android" (for example)

img | Requires code to be specified as "img:path-to-image.png" (for example)
All images are taken only from the folder with addons

custom | Usually created with the svgToIcon function and instead of code there should be either this function or a variable with this function

EXAMPLE

setTooltip(string Text)

Creates a tooltip when a button icon with text is hovered over it

setEvent(string Event, string Callback)

Creates an event and executes functions when the condition is met

click | Click with any mouse button

setIndicator(int Number)

Places a red indicator in the upper right corner of the button

removeIndicator()

Removes the indicator light from the button

active()

Makes the button active by recoloring it to yurba-brand-color CSS variable

unactive()

Removes the active status from the button

setCondition(string Type, string/bool Value)

Sets the status of the button

active | true/false, makes the button active or inactive

getProperties()

Reconstructs the object with all button parameters