From a4fff7c38397fa8fb59891cc94807be020ac37ec Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 28 Aug 2017 18:35:47 +0100 Subject: Fix unwanted body padding when a modal opens Prevents the test from failing --- js/src/modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/src/modal.js') diff --git a/js/src/modal.js b/js/src/modal.js index ab73230c8..a88c14444 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -426,7 +426,7 @@ const Modal = (($) => { } _checkScrollbar() { - this._isBodyOverflowing = document.body.clientWidth < window.innerWidth + this._isBodyOverflowing = document.body.offsetWidth < window.innerWidth this._scrollbarWidth = this._getScrollbarWidth() } -- cgit v1.2.3 From 2725acc9e576059e2dbb3e4722dd5beef84e9215 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 28 Aug 2017 18:44:56 +0100 Subject: Use jQuery outerWidth instead of offsetWidth --- js/src/modal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/src/modal.js') diff --git a/js/src/modal.js b/js/src/modal.js index a88c14444..c8c7e3d21 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -426,7 +426,7 @@ const Modal = (($) => { } _checkScrollbar() { - this._isBodyOverflowing = document.body.offsetWidth < window.innerWidth + this._isBodyOverflowing = $('body').outerWidth(true) < window.innerWidth this._scrollbarWidth = this._getScrollbarWidth() } -- cgit v1.2.3 From 3f2a8db4711e420b48b7a5b4c36f158a1b9eabab Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 28 Aug 2017 18:55:45 +0100 Subject: Use getBoundingClientRect instead of jQuery --- js/src/modal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/src/modal.js') diff --git a/js/src/modal.js b/js/src/modal.js index c8c7e3d21..0306b4e87 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -426,7 +426,8 @@ const Modal = (($) => { } _checkScrollbar() { - this._isBodyOverflowing = $('body').outerWidth(true) < window.innerWidth + const rect = document.body.getBoundingClientRect() + this._isBodyOverflowing = rect.left + rect.right < window.innerWidth this._scrollbarWidth = this._getScrollbarWidth() } -- cgit v1.2.3 From cbaf7a7b79c78ec7d877f348d12102acde6adfa0 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Tue, 29 Aug 2017 15:42:58 +0100 Subject: Fix failing test _adjustDialog should be called when the modal is first displayed to prevent it jumping position when the viewport is resized --- js/src/modal.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/src/modal.js') diff --git a/js/src/modal.js b/js/src/modal.js index ab73230c8..5892ed045 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -135,6 +135,8 @@ const Modal = (($) => { this._checkScrollbar() this._setScrollbar() + this._adjustDialog() + $(document.body).addClass(ClassName.OPEN) this._setEscapeEvent() -- cgit v1.2.3 From 9936bf59444c402b653f28449529eab83794e911 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Tue, 29 Aug 2017 21:16:00 +0200 Subject: Create a bundled release of Bootstrap with Popper.js inside --- js/src/modal.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/src/modal.js') diff --git a/js/src/modal.js b/js/src/modal.js index ab73230c8..2ff93342d 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -1,3 +1,4 @@ +import $ from 'jquery' import Util from './util' @@ -8,7 +9,7 @@ import Util from './util' * -------------------------------------------------------------------------- */ -const Modal = (($) => { +const Modal = (() => { /** -- cgit v1.2.3