From 283ab30164f0f58ffb13063d800b7a2ee686bb8a Mon Sep 17 00:00:00 2001 From: Johann-S Date: Wed, 11 Jul 2018 10:40:06 +0200 Subject: fix(modal): fix unit test and resetting style --- js/src/modal.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'js/src') diff --git a/js/src/modal.js b/js/src/modal.js index e7f9d2d96..29fcc76bf 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -431,7 +431,6 @@ const Modal = (($) => { // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT)) const stickyContent = [].slice.call(document.querySelectorAll(Selector.STICKY_CONTENT)) - const navbarToggler = [].slice.call(document.querySelectorAll(Selector.NAVBAR_TOGGLER)) // Adjust fixed content padding $(fixedContent).each((index, element) => { @@ -465,11 +464,8 @@ const Modal = (($) => { const fixedContent = [].slice.call(document.querySelectorAll(Selector.FIXED_CONTENT)) $(fixedContent).each((index, element) => { const padding = $(element).data('padding-right') - if (typeof padding !== 'undefined') { - $(element) - .css('padding-right', padding) - .removeData('padding-right') - } + $(element).removeData('padding-right') + element.style.paddingRight = padding ? padding : '' }) // Restore sticky content @@ -483,9 +479,8 @@ const Modal = (($) => { // Restore body padding const padding = $(document.body).data('padding-right') - if (typeof padding !== 'undefined') { - $(document.body).css('padding-right', padding).removeData('padding-right') - } + $(document.body).removeData('padding-right') + document.body.style.paddingRight = padding ? padding : '' } _getScrollbarWidth() { // thx d.walsh -- cgit v1.2.3