From 0b87aefca52a96ad8b72f03ee713e752383bb1cf Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Thu, 20 Aug 2015 10:30:07 +0500 Subject: [PATCH] don't turn window scroll lock on prompt --- js/interface_common.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/js/interface_common.js b/js/interface_common.js index db46264..730bbca 100644 --- a/js/interface_common.js +++ b/js/interface_common.js @@ -8,13 +8,13 @@ var window_scrollY = 0; function openModal(modal) { - window_scrollY = window.pageYOffset; - - $('body').css('overflow', 'hidden'); - - if (!modal.classBase) + if (!modal.classBase) { modal.classBase = '.modal-wrapper'; + window_scrollY = window.pageYOffset; + $('body').css('overflow', 'hidden'); + } + $(modal.classBase + ':not(#templates *)').remove(); modal.self = $('#templates ' + modal.classBase).clone(true) @@ -46,18 +46,19 @@ function openModal(modal) { function closeModal() { closeModalHandler('.modal-wrapper'); + window.location.hash = '#'; window.scroll(window.pageXOffset, window_scrollY); + $('body').css({ + 'overflow': 'auto', + 'margin-right': '0' + }); } function closeModalHandler(classBase) { var modalWindows = $(classBase+':not(#templates *)'); modalWindows.fadeOut('fast', function() {modalWindows.remove();}); - $('body').css({ - 'overflow': 'auto', - 'margin-right': '0' - }); } function checkNetworkStatusAndAskRedirect(cbFunc, cbArg) {