From f454700722953a98a93ca2f06a227c605dc76467 Mon Sep 17 00:00:00 2001 From: Randi Miller Date: Thu, 21 Mar 2019 14:37:35 -0400 Subject: [PATCH] extending equipment modal hack to address #11015 (#11070) * extending equipment modal hack to address #11015 * fix(modal): call hack only once, remove more dangling body props --- .../components/inventory/equipment/equipGearModal.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/website/client/components/inventory/equipment/equipGearModal.vue b/website/client/components/inventory/equipment/equipGearModal.vue index 0608337ad1d..9638bc77f99 100644 --- a/website/client/components/inventory/equipment/equipGearModal.vue +++ b/website/client/components/inventory/equipment/equipGearModal.vue @@ -4,6 +4,7 @@ v-if="item != null", :hide-header="true", @change="onChange($event)" + @hide="fixDocBody()" ) div.close span.svg-icon.inline.icon-10(aria-hidden="true", v-html="icons.close", @click="hideDialog()") @@ -187,8 +188,16 @@ }, hideDialog () { this.$root.$emit('bv::hide::modal', 'equipgear-modal'); + }, + fixDocBody () { document.body.classList.remove('modal-open'); - document.body.setAttribute('data-modal-open-count', document.body.getAttribute('data-modal-open-count') - 1); + if (document.body.getAttribute('data-modal-open-count') <= 1) { + document.body.removeAttribute('data-modal-open-count'); + } else { + document.body.setAttribute('data-modal-open-count', document.body.getAttribute('data-modal-open-count') - 1); + } + document.body.removeAttribute('data-padding-right'); + document.body.style.removeProperty('padding-right'); }, memberOverrideAvatarGear (gear) { return {