From 61dd1a3b4935d0466bfd77e026c19461d62b124f Mon Sep 17 00:00:00 2001 From: eugenijm Date: Thu, 23 Jul 2020 09:06:50 +0300 Subject: Add body 100% width for the preview, refactor the modalActivated watcher, use body scroll lock for the setting tab content --- src/components/settings_modal/settings_modal.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/components/settings_modal/settings_modal.js') diff --git a/src/components/settings_modal/settings_modal.js b/src/components/settings_modal/settings_modal.js index b6880445..4f54d6a3 100644 --- a/src/components/settings_modal/settings_modal.js +++ b/src/components/settings_modal/settings_modal.js @@ -38,17 +38,14 @@ const SettingsModal = { } }, watch: { + // This is the only way to access the element. modalActivated (newValue) { + let html = document.querySelector('html') + if (!html) return if (newValue) { - let html = document.querySelector('html') - if (html) { - html.classList.add('settings-modal-layout') - } + html.classList.add('settings-modal-layout') } else { - let html = document.querySelector('html') - if (html) { - html.classList.remove('settings-modal-layout') - } + html.classList.remove('settings-modal-layout') } } } -- cgit v1.2.3-70-g09d2