Skip to content
Snippets Groups Projects
Commit d56a22bb authored by Ere Maijala's avatar Ere Maijala Committed by André Lahmann
Browse files

Don't use window.location.reload() to refresh the page because it would warn...

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).
parent 3f84a29a
No related merge requests found
...@@ -99,12 +99,12 @@ VuFind.lightbox = (function() { ...@@ -99,12 +99,12 @@ VuFind.lightbox = (function() {
) { ) {
if (_originalUrl.match(/UserLogin/) || obj.url.match(/catalogLogin/)) { if (_originalUrl.match(/UserLogin/) || obj.url.match(/catalogLogin/)) {
var event = new CustomEvent('VuFind.lightbox.login', { var event = new CustomEvent('VuFind.lightbox.login', {
bubbles: true, bubbles: true,
cancelable: true cancelable: true
}); });
if (document.dispatchEvent(event)) { 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; return false;
} else { } else {
...@@ -241,7 +241,8 @@ VuFind.lightbox = (function() { ...@@ -241,7 +241,8 @@ VuFind.lightbox = (function() {
_modalBody = _modal.find('.modal-body'); _modalBody = _modal.find('.modal-body');
_modal.on('hide.bs.modal', function() { _modal.on('hide.bs.modal', function() {
if (VuFind.lightbox.refreshOnClose) { 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')); document.dispatchEvent(new Event('VuFind.lightbox.closing'));
}); });
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment