mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 15:54:03 +02:00
History: Do not push same url twice
This commit is contained in:
parent
ae68e8aec4
commit
2aca4dc6d5
@ -92,7 +92,7 @@
|
|||||||
// TODO: update navigation
|
// TODO: update navigation
|
||||||
// Did we find any URL? Then push it!
|
// Did we find any URL? Then push it!
|
||||||
if (url !== '') {
|
if (url !== '') {
|
||||||
window.history.pushState({icinga: true}, null, this.cleanupUrl(url));
|
this.push(url);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -101,13 +101,17 @@
|
|||||||
if (!this.enabled) {
|
if (!this.enabled) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.history.pushState({icinga: true}, null, this.cleanupUrl(url));
|
this.push(url);
|
||||||
},
|
},
|
||||||
|
|
||||||
cleanupUrl: function(url) {
|
push: function (url) {
|
||||||
url = url.replace(/_render=[a-z0-9]+&/, '').replace(/&_render=[a-z0-9]+/, '').replace(/\?_render=[a-z0-9]+$/, '');
|
url = url.replace(/_render=[a-z0-9]+&/, '').replace(/&_render=[a-z0-9]+/, '').replace(/\?_render=[a-z0-9]+$/, '');
|
||||||
url = url.replace(/_reload=[a-z0-9]+&/, '').replace(/&_reload=[a-z0-9]+/, '').replace(/\?_reload=[a-z0-9]+$/, '');
|
url = url.replace(/_reload=[a-z0-9]+&/, '').replace(/&_reload=[a-z0-9]+/, '').replace(/\?_reload=[a-z0-9]+$/, '');
|
||||||
return url;
|
if (this.lastPushUrl === url) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.lastPushUrl = url;
|
||||||
|
window.history.pushState({icinga: true}, null, url);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user