Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional API methods for Alert #112

Open
VizuaaLOG opened this issue Nov 26, 2020 · 0 comments
Open

Additional API methods for Alert #112

VizuaaLOG opened this issue Nov 26, 2020 · 0 comments
Assignees
Milestone

Comments

@VizuaaLOG
Copy link
Owner

VizuaaLOG commented Nov 26, 2020

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.

@VizuaaLOG VizuaaLOG self-assigned this Nov 26, 2020
@VizuaaLOG VizuaaLOG added this to the 0.13 milestone Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant