From fb734b50962744f4cdfc51e7a228de18bc96130a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 1 Sep 2017 09:49:18 +0300 Subject: www: trying to fix modal window --- juick-www/src/main/static/scripts.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'juick-www/src/main/static/scripts.js') diff --git a/juick-www/src/main/static/scripts.js b/juick-www/src/main/static/scripts.js index a12ec709..c6a960f0 100644 --- a/juick-www/src/main/static/scripts.js +++ b/juick-www/src/main/static/scripts.js @@ -524,7 +524,9 @@ function openDialog(html) { ${html} `; - document.querySelector('body').insertAdjacentHTML('afterbegin', dialogHtml); + let body = document.querySelector('body'); + body.classList.add('dialog-opened'); + body.insertAdjacentHTML('afterbegin', dialogHtml); document.addEventListener('keydown', closeDialogListener); document.querySelector('#dialogb').addEventListener('click', closeDialog); document.querySelector('#dialogc').addEventListener('click', closeDialog); @@ -535,6 +537,7 @@ function closeDialog() { if (draft) { window.draft = draft.value; } + document.querySelector('body').classList.remove('dialog-opened'); document.querySelector('#dialogb').remove(); document.querySelector('#dialogt').remove(); } -- cgit v1.2.3