You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Over the next few versions I think it would great to expand the API methods available, allowing certain settings to be changed at run time, rather than needing to recreate the component. The below are ideas for the alert popup, any other ideas please just comment!
hide() - Hides the alert
show() - Shows the alert
toggle() - Toggles the visibility of the alert
type(new_type: string) - Changes the alert's type, adjusting the CSS classes applied
title(new_title: string) - Changes the title of the alert
body(new_body: string) - Changes the body of the alert
confirmLabel(new_label: string) - Changes the label for the confirm button
confirmClose(new_state: boolean) - Sets if the confirm button will close the alert
confirmDestroy(new_state: boolean) - Sets if the confirm button will destroy the alert
cancelLabel(new_label: string) - Changes the label for the cancel button
cancelClose(new_state: boolean) - Sets if the cancel button will close the alert
cancelDestroy(new_state: boolean) - Sets if the cancel button will destroy the alert
isVisible(): boolean - Returns true if the alert is visible, false otherwise
trigger(event_name: string) - This will trigger the provided event on the alert instance. Note: This wouldn't be restricted to documented events, so could be used for handling custom events
It's likely the open / close events will also be renamed to show / hide respectively. It's more descriptive of what's actually happening, an alert is shown not opened.
The methods above will also be able to get the relevant value by not providing the parameters.
The text was updated successfully, but these errors were encountered:
Over the next few versions I think it would great to expand the API methods available, allowing certain settings to be changed at run time, rather than needing to recreate the component. The below are ideas for the alert popup, any other ideas please just comment!
hide()
- Hides the alertshow()
- Shows the alerttoggle()
- Toggles the visibility of the alerttype(new_type: string)
- Changes the alert's type, adjusting the CSS classes appliedtitle(new_title: string)
- Changes the title of the alertbody(new_body: string)
- Changes the body of the alertconfirmLabel(new_label: string)
- Changes the label for the confirm buttonconfirmClose(new_state: boolean)
- Sets if the confirm button will close the alertconfirmDestroy(new_state: boolean)
- Sets if the confirm button will destroy the alertcancelLabel(new_label: string)
- Changes the label for the cancel buttoncancelClose(new_state: boolean)
- Sets if the cancel button will close the alertcancelDestroy(new_state: boolean)
- Sets if the cancel button will destroy the alertisVisible(): boolean
- Returns true if the alert is visible, false otherwisetrigger(event_name: string)
- This will trigger the provided event on the alert instance. Note: This wouldn't be restricted to documented events, so could be used for handling custom eventsIt's likely the open / close events will also be renamed to show / hide respectively. It's more descriptive of what's actually happening, an alert is shown not opened.
The methods above will also be able to get the relevant value by not providing the parameters.
The text was updated successfully, but these errors were encountered: