Q.Dialogs Class
Operates with dialogs.
Methods
pop
-
dontTriggerClose
Closes dialog and removes it from top of internal dialog stack.
Parameters:
-
dontTriggerClose
Booleanis for internal use only
Returns:
The HTML element of the dialog that was just popped.
push
-
options
Shows the dialog and pushes it on top of internal dialog stack.
Parameters:
-
options
ObjectA hash of options. For more options see Q/dialog tool.
-
[apply]
Boolean optionalOptional. Set to true if the dialog should show the "apply" style button to close dialog
-
[dialog]
Element | JQuery optionalIf provided, may be Element or jQuery object containing already prepared dialog html structure with 'Q_title_slot', 'Q_dialog_slot' and appropriate content in them. If the 'title', 'content' or 'template' options are provided, they will be used to replace the content in this element.
-
[url]
String optionalOptional. If provided, this url will be used to fetch the "title" and "dialog" slots, to display in the dialog. Thus the default content provided by 'title' and 'content' options given below will be replaced after the response comes back.
-
[title='Dialog']
String | Element optionalinitial dialog title.
-
[content]
String | Element optionalinitial dialog content. If the url is not supplied, then this remains the HTML content of the dialog. By default displays an image of a throbber while the url is loading.
-
[template]
Object optionalcan be used instead of content option.
-
[className]
String optionala CSS class name or space-separated list of classes to append to the dialog element.
-
[htmlClass]
String optionalAny class to add to the html element while the overlay is open
-
[mask]
String optionalDefault is true unless fullscreen option is true. If true, adds a mask to cover the screen behind the dialog. If a string, this is passed as the className of the mask.
-
[stylesheet]
String | Array optionalAny stylesheets to load before dialog, to prevent Flash of Unstyled Content. should show the "apply" style button to close dialog
-
[fullscreen]
Boolean optionalDefaults to true only on Android and false on all other platforms. If true, dialog will be shown not as overlay but instead will be prepended to document.body and all other child elements of the body will be hidden. Thus dialog will occupy all window space, but still will behave like regular dialog, i.e. it can be closed by clicking / tapping close icon.
-
[hidePrevious=false]
Boolean optionalWhether to hide the current topmost dialog, and show it again when this newly displayed dialog will be closed
-
[appendTo]
HTMLElement, jQuery optionalCan be DOM element, jQuery object or jQuery selector matching element where dialog should be appended. Moreover, dialog is centered relatively to this element. By default it's document body.
-
[alignByParent=false]
Boolean optionalif true, the dialog will be aligned to the center of not the entire window, but to the center of containing element instead.
-
[noClose=false]
Boolean optionalif true, overlay close button will not appear and overlay won't be closed by pressing 'Esc' key.
-
[closeOnEsc=true]
Boolean optionalindicates whether to close overlay on 'Esc' key press. Has sense only if 'noClose' is false.
-
[removeOnClose]
Boolean optionalDefaults to false if "dialog" is provided, and true otherwise. If true, dialog DOM element will be removed from the document on close.
-
[beforeLoad]
Q.Event optionalQ.Event or function which is called before dialog is loaded.
-
[onActivate]
Q.Event optionalQ.Event or function which is called when dialog is activated (all inner tools, if any, are activated and dialog is fully loaded and shown).
-
[beforeClose]
Q.Event optionalbeforeClose Q.Event or function which is called when overlay closing was initiated and it's still visible. Can return false to cancel closing.
-
[onClose]
Q.Event optionalOptional. Q.Event or function which is called when dialog is closed and hidden and probably removed from DOM (if 'removeOnClose' is 'true').
-
Returns:
The HTML element of the dialog that was just pushed.