Constructor
new Button(type)
Parameters:
Name | Type | Description |
---|---|---|
type |
string | one of available button types |
Methods
asDanger(outline) → {Button}
Sets as danger button.
Parameters:
Name | Type | Description |
---|---|---|
outline |
boolean | null | specifies outline mode |
Returns:
this
- Type
- Button
asDark(outline) → {Button}
Sets as dark button.
Parameters:
Name | Type | Description |
---|---|---|
outline |
boolean | null | specifies outline mode |
Returns:
this
- Type
- Button
asInfo(outline) → {Button}
Sets as info button.
Parameters:
Name | Type | Description |
---|---|---|
outline |
boolean | null | specifies outline mode |
Returns:
this
- Type
- Button
asLight(outline) → {Button}
Sets as light button.
Parameters:
Name | Type | Description |
---|---|---|
outline |
boolean | null | specifies outline mode |
Returns:
this
- Type
- Button
asLink() → {Button}
Sets as link button.
Returns:
this
- Type
- Button
asPrimary(outline) → {Button}
Sets as primary button.
Parameters:
Name | Type | Description |
---|---|---|
outline |
boolean | null | specifies outline mode |
Returns:
this
- Type
- Button
asSecondary(outline) → {Button}
Sets as secondary button.
Parameters:
Name | Type | Description |
---|---|---|
outline |
boolean | null | specifies outline mode |
Returns:
this
- Type
- Button
asSuccess(outline) → {Button}
Sets as success button.
Parameters:
Name | Type | Description |
---|---|---|
outline |
boolean | null | specifies outline mode |
Returns:
this
- Type
- Button
asWarning(outline) → {Button}
Sets as warning button.
Parameters:
Name | Type | Description |
---|---|---|
outline |
boolean | null | specifies outline mode |
Returns:
this
- Type
- Button
disable() → {Button}
Disable button.
Returns:
this
- Type
- Button
enable() → {Button}
Enable button.
Returns:
this
- Type
- Button
onClick(fun, text) → {Button}
Binds a function for the onclick event.
Parameters:
Name | Type | Description |
---|---|---|
fun |
function | |
text |
string | null | undefined | the loading message displayed in button after click |
Returns:
this
- Type
- Button
runSpinner(text) → {string}
Replaces inner HTML with a loading spinner.
Parameters:
Name | Type | Description |
---|---|---|
text |
string | null | undefined | the loading message |
Returns:
replaced inner HTML
- Type
- string