From d56a22bb1742b2eb97abcf59b0bc816b83651821 Mon Sep 17 00:00:00 2001 From: Ere Maijala <ere.maijala@helsinki.fi> Date: Thu, 10 Mar 2016 13:25:34 +0200 Subject: [PATCH] Don't use window.location.reload() to refresh the page because it would warn about any POST parameters (e.g. login right after changing language). --- themes/bootstrap3/js/lightbox.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/themes/bootstrap3/js/lightbox.js b/themes/bootstrap3/js/lightbox.js index dc1e07dd9b7..6c55c98c1c3 100644 --- a/themes/bootstrap3/js/lightbox.js +++ b/themes/bootstrap3/js/lightbox.js @@ -99,12 +99,12 @@ VuFind.lightbox = (function() { ) { if (_originalUrl.match(/UserLogin/) || obj.url.match(/catalogLogin/)) { var event = new CustomEvent('VuFind.lightbox.login', { - bubbles: true, - cancelable: true + bubbles: true, + cancelable: true }); - if (document.dispatchEvent(event)) { - window.location.reload(); + // No reload since any post params would cause a prompt + window.location.href = window.location.href; } return false; } else { @@ -241,7 +241,8 @@ VuFind.lightbox = (function() { _modalBody = _modal.find('.modal-body'); _modal.on('hide.bs.modal', function() { if (VuFind.lightbox.refreshOnClose) { - window.location.reload(); + // No reload since any post params would cause a prompt + window.location.href = window.location.href; } document.dispatchEvent(new Event('VuFind.lightbox.closing')); }); -- GitLab