From ef8ee3302bfd282a841266e14f3e7a849e369ddb Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Wed, 26 Aug 2015 15:23:58 +0200 Subject: [PATCH] Improve JS error handling Refresh URL after loading erroring containers, when the user refreshes he expects to reload the page he just loaded and not the previous one. --- public/js/icinga/loader.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index 92bd4810a..fb324cc74 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -589,9 +589,8 @@ }); } - // Update history when necessary. Don't do so for requests triggered - // by history or autorefresh events - if (! req.autorefresh && req.addToHistory) { + // Update history when necessary + if (req.addToHistory) { if (req.$target.hasClass('container')) { // We only want to care about top-level containers if (req.$target.parent().closest('.container').length === 0) { @@ -633,9 +632,10 @@ /* * Test if a manual actions comes in and autorefresh is active: Stop refreshing */ - if (req.addToHistory && ! req.autorefresh && req.$target.data('icingaRefresh') > 0) { + if (req.addToHistory && ! req.autorefresh) { req.$target.data('icingaRefresh', 0); req.$target.data('icingaUrl', url); + icinga.history.pushCurrentState(); } if (typeof req.progressTimer !== 'undefined') {