diff options
| author | Mark Otto <[email protected]> | 2016-05-11 11:07:06 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2016-05-11 11:07:06 -0700 |
| commit | b280e36b788e4b42bbb359f0a13db410adf7dd8c (patch) | |
| tree | bc8115b9b11cb78767655917a482c25c9f711526 /js/src | |
| parent | ef50b7839cb2ca9171eec12c2bf22fc38ad9d7ae (diff) | |
| parent | 9d6b41c1276af04d5e81043059035660add82b8d (diff) | |
| download | bootstrap-b280e36b788e4b42bbb359f0a13db410adf7dd8c.tar.xz bootstrap-b280e36b788e4b42bbb359f0a13db410adf7dd8c.zip | |
Merge branch 'v4-dev' into v4-split-buttons
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() } |
