loader.js: Push current state to history only on `onComplete`.
- Previously, in case of `abort` the url was already pushed to history at the beginning of `onFailure`, setting `addToHistory` to true only prevents it from being added twice (again in `onComplete`). - Now we only push the url to history in `onComplete`, so setting `addToHistory` to false is only necessary if req is scripted. - We intentionally push the canceled url into history to continue navigating with the browser`s back/forward key.
This commit is contained in:
parent
d794439537
commit
9dd21841a3
|
@ -1061,7 +1061,6 @@
|
||||||
if (req.addToHistory && ! req.autorefresh) {
|
if (req.addToHistory && ! req.autorefresh) {
|
||||||
req.$target.data('icingaRefresh', 0);
|
req.$target.data('icingaRefresh', 0);
|
||||||
req.$target.data('icingaUrl', url);
|
req.$target.data('icingaUrl', url);
|
||||||
icinga.history.pushCurrentState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof req.progressTimer !== 'undefined') {
|
if (typeof req.progressTimer !== 'undefined') {
|
||||||
|
@ -1090,8 +1089,9 @@
|
||||||
req.$target
|
req.$target
|
||||||
);
|
);
|
||||||
|
|
||||||
// Aborted requests should not be added to browser history
|
if (req.scripted) {
|
||||||
req.addToHistory = false;
|
req.addToHistory = false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.failureNotice === null) {
|
if (this.failureNotice === null) {
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
|
|
Loading…
Reference in New Issue