mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-26 03:09:10 +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;
|
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 _this = this;
|
||||||
var req = $.ajax({
|
var req = $.ajax({
|
||||||
type : method,
|
type : method,
|
||||||
@ -151,8 +158,9 @@
|
|||||||
req.autorefresh = autorefresh;
|
req.autorefresh = autorefresh;
|
||||||
req.method = method;
|
req.method = method;
|
||||||
req.action = action;
|
req.action = action;
|
||||||
req.addToHistory = headers['X-Icinga-Modal'] !== true && true;
|
req.addToHistory = isModal !== true && true;
|
||||||
req.progressTimer = progressTimer;
|
req.progressTimer = progressTimer;
|
||||||
|
req.modal = isModal;
|
||||||
|
|
||||||
if (url.match(/#/)) {
|
if (url.match(/#/)) {
|
||||||
req.forceFocus = url.split(/#/)[1];
|
req.forceFocus = url.split(/#/)[1];
|
||||||
@ -669,6 +677,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.processRedirectHeader(req)) {
|
if (this.processRedirectHeader(req)) {
|
||||||
|
if (req.modal) {
|
||||||
|
icinga.behaviors.modal.hide();
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user