From 1d29ef0353e045970c6d841826653f56be3642fd Mon Sep 17 00:00:00 2001 From: ysds Date: Wed, 21 Nov 2018 11:54:42 +0900 Subject: [PATCH 1/2] Add `.modal-open` class at the same time changing padding-right --- js/src/modal.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/src/modal.js b/js/src/modal.js index 74a16d461119..f4c9bb31a17d 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -127,8 +127,6 @@ class Modal { this._adjustDialog() - $(document.body).addClass(ClassName.OPEN) - this._setEscapeEvent() this._setResizeEvent() @@ -465,6 +463,7 @@ class Modal { $(document.body) .data('padding-right', actualPadding) .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`) + .addClass(ClassName.OPEN) } } From bd05f7d1beb0f13b38f7e517092424b81231745c Mon Sep 17 00:00:00 2001 From: ysds Date: Wed, 21 Nov 2018 23:47:52 +0900 Subject: [PATCH 2/2] Move outside of `if` statement --- js/src/modal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/src/modal.js b/js/src/modal.js index f4c9bb31a17d..5dfb64407ed6 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -463,8 +463,9 @@ class Modal { $(document.body) .data('padding-right', actualPadding) .css('padding-right', `${parseFloat(calculatedPadding) + this._scrollbarWidth}px`) - .addClass(ClassName.OPEN) } + + $(document.body).addClass(ClassName.OPEN) } _resetScrollbar() {