aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/js/src/modal.js
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2020-08-22 19:40:57 +0200
committerMario Vavti <mario@mariovavti.com>2020-08-22 19:40:57 +0200
commita9e19cb89ed08689dc58c92b3d5491318a703f0e (patch)
tree468e236e5cb4927a4fd01f650fab7ad9f6cfc895 /vendor/twbs/bootstrap/js/src/modal.js
parent48786119871aaf1029fac12a37d212afddafc757 (diff)
downloadvolse-hubzilla-a9e19cb89ed08689dc58c92b3d5491318a703f0e.tar.gz
volse-hubzilla-a9e19cb89ed08689dc58c92b3d5491318a703f0e.tar.bz2
volse-hubzilla-a9e19cb89ed08689dc58c92b3d5491318a703f0e.zip
composer update bootstrap
Diffstat (limited to 'vendor/twbs/bootstrap/js/src/modal.js')
-rw-r--r--vendor/twbs/bootstrap/js/src/modal.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/vendor/twbs/bootstrap/js/src/modal.js b/vendor/twbs/bootstrap/js/src/modal.js
index 7338ffd37..b67507b1e 100644
--- a/vendor/twbs/bootstrap/js/src/modal.js
+++ b/vendor/twbs/bootstrap/js/src/modal.js
@@ -1,7 +1,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.5.0): modal.js
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
+ * Bootstrap (v4.5.2): modal.js
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -15,7 +15,7 @@ import Util from './util'
*/
const NAME = 'modal'
-const VERSION = '4.5.0'
+const VERSION = '4.5.2'
const DATA_KEY = 'bs.modal'
const EVENT_KEY = `.${DATA_KEY}`
const DATA_API_KEY = '.data-api'
@@ -238,12 +238,25 @@ class Modal {
return
}
+ const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight
+
+ if (!isModalOverflowing) {
+ this._element.style.overflowY = 'hidden'
+ }
+
this._element.classList.add(CLASS_NAME_STATIC)
- const modalTransitionDuration = Util.getTransitionDurationFromElement(this._element)
+ const modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog)
+ $(this._element).off(Util.TRANSITION_END)
$(this._element).one(Util.TRANSITION_END, () => {
this._element.classList.remove(CLASS_NAME_STATIC)
+ if (!isModalOverflowing) {
+ $(this._element).one(Util.TRANSITION_END, () => {
+ this._element.style.overflowY = ''
+ })
+ .emulateTransitionEnd(this._element, modalTransitionDuration)
+ }
})
.emulateTransitionEnd(modalTransitionDuration)
this._element.focus()
@@ -265,6 +278,7 @@ class Modal {
this._element.style.display = 'block'
this._element.removeAttribute('aria-hidden')
this._element.setAttribute('aria-modal', true)
+ this._element.setAttribute('role', 'dialog')
if ($(this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
modalBody.scrollTop = 0
@@ -344,6 +358,7 @@ class Modal {
this._element.style.display = 'none'
this._element.setAttribute('aria-hidden', true)
this._element.removeAttribute('aria-modal')
+ this._element.removeAttribute('role')
this._isTransitioning = false
this._showBackdrop(() => {
$(document.body).removeClass(CLASS_NAME_OPEN)