diff options
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/button.js | 3 | ||||
| -rw-r--r-- | js/src/modal.js | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/js/src/button.js b/js/src/button.js index 3144a3f10..39e2b3974 100644 --- a/js/src/button.js +++ b/js/src/button.js @@ -92,7 +92,10 @@ const Button = (($) => { input.checked = !$(this._element).hasClass(ClassName.ACTIVE) $(this._element).trigger('change') } + + input.focus() } + } else { this._element.setAttribute('aria-pressed', !$(this._element).hasClass(ClassName.ACTIVE)) diff --git a/js/src/modal.js b/js/src/modal.js index 202c5fe94..695ac569b 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -223,6 +223,7 @@ const Modal = (($) => { } this._element.style.display = 'block' + this._element.removeAttribute('aria-hidden') this._element.scrollTop = 0 if (transition) { @@ -290,6 +291,7 @@ const Modal = (($) => { _hideModal() { this._element.style.display = 'none' + this._element.setAttribute('aria-hidden', 'true') this._showBackdrop(() => { $(document.body).removeClass(ClassName.OPEN) this._resetAdjustments() @@ -408,13 +410,7 @@ const Modal = (($) => { } _checkScrollbar() { - let fullWindowWidth = window.innerWidth - if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 - let documentElementRect = document.documentElement.getBoundingClientRect() - fullWindowWidth = - documentElementRect.right - Math.abs(documentElementRect.left) - } - this._isBodyOverflowing = document.body.clientWidth < fullWindowWidth + this._isBodyOverflowing = document.body.clientWidth < window.innerWidth this._scrollbarWidth = this._getScrollbarWidth() } |
