mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-24 10:27:46 +02:00
Modal: Not add modal requests to history
This commit is contained in:
parent
fce3f0fdc8
commit
cf65d4d626
@ -531,8 +531,25 @@
|
|||||||
$target = _this.getLinkTargetFor($a);
|
$target = _this.getLinkTargetFor($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var additionalHeader;
|
||||||
|
|
||||||
|
if ($a.data('icinga-modal') === true) {
|
||||||
|
additionalHeader = {
|
||||||
|
'X-Icinga-Modal': true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Load link URL
|
// Load link URL
|
||||||
icinga.loader.loadUrl(href, $target);
|
icinga.loader.loadUrl(
|
||||||
|
href,
|
||||||
|
$target,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
additionalHeader
|
||||||
|
);
|
||||||
|
|
||||||
if ($a.closest('#menu').length > 0) {
|
if ($a.closest('#menu').length > 0) {
|
||||||
// Menu links should remove all but the first layout column
|
// Menu links should remove all but the first layout column
|
||||||
|
@ -57,8 +57,9 @@
|
|||||||
* @param {string} action How to handle the response ('replace' or 'append'), default is 'replace'
|
* @param {string} action How to handle the response ('replace' or 'append'), default is 'replace'
|
||||||
* @param {boolean} autorefresh Whether the cause is a autorefresh or not
|
* @param {boolean} autorefresh Whether the cause is a autorefresh or not
|
||||||
* @param {object} progressTimer A timer to be stopped when the request is done
|
* @param {object} progressTimer A timer to be stopped when the request is done
|
||||||
|
* @param {object} additionalHeader Custom request headers
|
||||||
*/
|
*/
|
||||||
loadUrl: function (url, $target, data, method, action, autorefresh, progressTimer) {
|
loadUrl: function (url, $target, data, method, action, autorefresh, progressTimer, additionalHeader) {
|
||||||
var id = null;
|
var id = null;
|
||||||
|
|
||||||
// Default method is GET
|
// Default method is GET
|
||||||
@ -105,6 +106,10 @@
|
|||||||
// Not sure whether we need this Accept-header
|
// Not sure whether we need this Accept-header
|
||||||
var headers = { 'X-Icinga-Accept': 'text/html' };
|
var headers = { 'X-Icinga-Accept': 'text/html' };
|
||||||
|
|
||||||
|
if (typeof additionalHeader === 'object') {
|
||||||
|
headers = $.extend(headers, additionalHeader);
|
||||||
|
}
|
||||||
|
|
||||||
// Ask for a new window id in case we don't already have one
|
// Ask for a new window id in case we don't already have one
|
||||||
if (this.icinga.ui.hasWindowId()) {
|
if (this.icinga.ui.hasWindowId()) {
|
||||||
var windowId = this.icinga.ui.getWindowId();
|
var windowId = this.icinga.ui.getWindowId();
|
||||||
@ -146,7 +151,7 @@
|
|||||||
req.autorefresh = autorefresh;
|
req.autorefresh = autorefresh;
|
||||||
req.method = method;
|
req.method = method;
|
||||||
req.action = action;
|
req.action = action;
|
||||||
req.addToHistory = true;
|
req.addToHistory = headers['X-Icinga-Modal'] !== true && true;
|
||||||
req.progressTimer = progressTimer;
|
req.progressTimer = progressTimer;
|
||||||
|
|
||||||
if (url.match(/#/)) {
|
if (url.match(/#/)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user