Handles the shown
event.
The name of the button.
True if the button is primary. A modal takes only one primary button but no check is made by this method to prevent it. The primary button is the one clicked if the user hits enter.
The jQuery object for the button.
Adds one Ok and one Cancel button.
The two buttons added.
Adds one Yes and one No button.
The two buttons added.
The button that was clicked. Could be undefined if the modal disappeared without being normally dismissed or if the modal has not been used yet.
The text of the button that was clicked. Could be undefined if the modal disappeared without being normally dismissed or if the modal has not been used yet.
Returns the primary button.
The primary button.
The top level node of the modal, to be inserted into a page.
A callback to call when the modal is dismissed by the user. This modal would typically inspect the modal to determine what the user did, and potentially clean up after itself. The callback is left out if the modal is merely for informational purposes.
Set the body of this modal.
Set the footer of this modal.
Set the title of this modal.
Generated using TypeDoc
A modal needs to be created only once per instance of wed. After creation it must be installed into the DOM tree of the page on which it is going to be used. The method Modal.getTopLevel must be used to get the top level DOM element of the modal which will be inserted into the page. Once inserted, the modal is ready to be used once, twice, or more times. It need not be removed, re-created, etc. The method Modal.modal just needs to be called each time the modal must be displayed.
A typical usage scenario would be:
If the same modal must be displayed on two different pages, then two Modal objects should be created, one per page.