mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-25 18:59:04 +02:00
Modal: Modal request detection and hide if success
This commit is contained in:
parent
cf65d4d626
commit
8ea0908841
@ -132,6 +132,13 @@
|
||||
contentType = false;
|
||||
}
|
||||
|
||||
var isModal = headers['X-Icinga-Modal'] === true && true;
|
||||
|
||||
if (! isModal && $target.closest('#modal-overlay')) {
|
||||
isModal = true;
|
||||
headers['X-Icinga-Modal'] = true;
|
||||
}
|
||||
|
||||
var _this = this;
|
||||
var req = $.ajax({
|
||||
type : method,
|
||||
@ -151,8 +158,9 @@
|
||||
req.autorefresh = autorefresh;
|
||||
req.method = method;
|
||||
req.action = action;
|
||||
req.addToHistory = headers['X-Icinga-Modal'] !== true && true;
|
||||
req.addToHistory = isModal !== true && true;
|
||||
req.progressTimer = progressTimer;
|
||||
req.modal = isModal;
|
||||
|
||||
if (url.match(/#/)) {
|
||||
req.forceFocus = url.split(/#/)[1];
|
||||
@ -669,6 +677,10 @@
|
||||
}
|
||||
|
||||
if (this.processRedirectHeader(req)) {
|
||||
if (req.modal) {
|
||||
icinga.behaviors.modal.hide();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user