The Dialog module provides a mechanism for launching modal dialogs from within an add-on's iframe. A modal dialog displays information without requiring the user to leave the current page. The dialog is opened over the entire window, rather than within the iframe itself.
For more information, read about the Atlassian User Interface dialog component.
Methods
-
close(data) -
Closes the currently open dialog. Optionally pass data to listeners of the
dialog.closeevent. This will only close a dialog that has been opened by your add-on. You can register for close events using thedialog.closeevent and the events moduleParameters:
Name Type Description dataObject An object to be emitted on dialog close.
Example
AP.require('dialog', function(dialog){ dialog.close({foo: 'bar'}); }); -
create() -
Creates a dialog for a module key
Example
AP.require('dialog', function(dialog){ dialog.create('mydialog'); }); -
getButton() → {DialogButton} -
Returns the button that was requested (either cancel or submit)
Returns:
DialogButtonExample
AP.require('dialog', function(dialog){ dialog.getButton('submit'); }); -
onDialogMessage(String, Function) -
register callbacks responding to messages from the host dialog, such as "submit" or "cancel"
Parameters:
Name Type Description Stringbutton either "cancel" or "submit"
Functioncallback function
- This functionality is deprecated and may be removed in the future.