js: add support for non modal dialogs (#10629)

This commit is contained in:
Frédéric Péters 2016-04-12 13:42:20 +02:00
parent d8c9a55a5d
commit 984acfdaea
1 changed files with 8 additions and 1 deletions

View File

@ -38,12 +38,19 @@ var gadjo_js = gadjo_js || {};
* Submit is done in place if the $anchor has a data-inplace-submit="true"
* attribute, a gadjo:dialog-done event is triggered on success, a
* gadjo:dialog-submit-error event is triggered on failure.
*
* Dialog is modal by default, set data-modal="false" for non-modal
* dialogs.
*/
var $anchor = $(this);
var url = $anchor.attr('href') || $anchor.data('url');
var selector = $anchor.data('selector') || 'form:not(.gadjo-popup-ignore)';
var title_selector = $anchor.data('title-selector') || '#appbar h2';
var inplace_submit = $anchor.data('inplace-submit');
var modal = $anchor.data('modal');
if (modal === undefined) {
modal = true;
}
function show_error(message) {
/* Add a div to body to show an error message and fade it out after 3
@ -112,7 +119,7 @@ var gadjo_js = gadjo_js || {};
var title = $html.find(title_selector).text();
$form.dialog({
modal: true,
modal: modal,
'title': title,
width: 'auto',
close: function (ev, ui) {