aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/js/src/toast.js
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-12-12 14:51:10 +0000
committerMario <mario@mariovavti.com>2019-12-12 14:51:10 +0000
commit544ef3bc588d4180d7ecad15bdacd43813a7c5c5 (patch)
tree62372d0af859287235f62f20d0cf55b5b5b1ace3 /vendor/twbs/bootstrap/js/src/toast.js
parent124cc4396247c75c14280136cfaa95415860ad4c (diff)
downloadvolse-hubzilla-544ef3bc588d4180d7ecad15bdacd43813a7c5c5.tar.gz
volse-hubzilla-544ef3bc588d4180d7ecad15bdacd43813a7c5c5.tar.bz2
volse-hubzilla-544ef3bc588d4180d7ecad15bdacd43813a7c5c5.zip
update composer libs and minor notifications display fixes
Diffstat (limited to 'vendor/twbs/bootstrap/js/src/toast.js')
-rw-r--r--vendor/twbs/bootstrap/js/src/toast.js33
1 files changed, 20 insertions, 13 deletions
diff --git a/vendor/twbs/bootstrap/js/src/toast.js b/vendor/twbs/bootstrap/js/src/toast.js
index 4aef2d40c..6e2a00783 100644
--- a/vendor/twbs/bootstrap/js/src/toast.js
+++ b/vendor/twbs/bootstrap/js/src/toast.js
@@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v4.3.1): toast.js
+ * Bootstrap (v4.4.1): toast.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -15,7 +15,7 @@ import Util from './util'
*/
const NAME = 'toast'
-const VERSION = '4.3.1'
+const VERSION = '4.4.1'
const DATA_KEY = 'bs.toast'
const EVENT_KEY = `.${DATA_KEY}`
const JQUERY_NO_CONFLICT = $.fn[NAME]
@@ -82,7 +82,12 @@ class Toast {
// Public
show() {
- $(this._element).trigger(Event.SHOW)
+ const showEvent = $.Event(Event.SHOW)
+
+ $(this._element).trigger(showEvent)
+ if (showEvent.isDefaultPrevented()) {
+ return
+ }
if (this._config.animation) {
this._element.classList.add(ClassName.FADE)
@@ -95,11 +100,14 @@ class Toast {
$(this._element).trigger(Event.SHOWN)
if (this._config.autohide) {
- this.hide()
+ this._timeout = setTimeout(() => {
+ this.hide()
+ }, this._config.delay)
}
}
this._element.classList.remove(ClassName.HIDE)
+ Util.reflow(this._element)
this._element.classList.add(ClassName.SHOWING)
if (this._config.animation) {
const transitionDuration = Util.getTransitionDurationFromElement(this._element)
@@ -112,20 +120,19 @@ class Toast {
}
}
- hide(withoutTimeout) {
+ hide() {
if (!this._element.classList.contains(ClassName.SHOW)) {
return
}
- $(this._element).trigger(Event.HIDE)
+ const hideEvent = $.Event(Event.HIDE)
- if (withoutTimeout) {
- this._close()
- } else {
- this._timeout = setTimeout(() => {
- this._close()
- }, this._config.delay)
+ $(this._element).trigger(hideEvent)
+ if (hideEvent.isDefaultPrevented()) {
+ return
}
+
+ this._close()
}
dispose() {
@@ -165,7 +172,7 @@ class Toast {
$(this._element).on(
Event.CLICK_DISMISS,
Selector.DATA_DISMISS,
- () => this.hide(true)
+ () => this.hide()
)
}