diff options
author | XhmikosR <xhmikosr@gmail.com> | 2020-06-12 21:50:30 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2020-09-10 12:06:30 +0300 |
commit | 3be585990cd017736df97a418e135e5cf2382d5a (patch) | |
tree | 6c094dd4c9c4610445408ae5e46372198c6492c4 /js/src/toast.js | |
parent | 1c37a2ba77002331376c0b70abb7fc1acf02a70b (diff) |
Comply to the new rules
Diffstat (limited to 'js/src/toast.js')
-rw-r--r-- | js/src/toast.js | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/js/src/toast.js b/js/src/toast.js index 8709d84e19..1959e72a61 100644 --- a/js/src/toast.js +++ b/js/src/toast.js @@ -14,33 +14,33 @@ import Util from './util' * ------------------------------------------------------------------------ */ -const NAME = 'toast' -const VERSION = '4.5.2' -const DATA_KEY = 'bs.toast' -const EVENT_KEY = `.${DATA_KEY}` +const NAME = 'toast' +const VERSION = '4.5.2' +const DATA_KEY = 'bs.toast' +const EVENT_KEY = `.${DATA_KEY}` const JQUERY_NO_CONFLICT = $.fn[NAME] const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}` -const EVENT_HIDE = `hide${EVENT_KEY}` -const EVENT_HIDDEN = `hidden${EVENT_KEY}` -const EVENT_SHOW = `show${EVENT_KEY}` -const EVENT_SHOWN = `shown${EVENT_KEY}` - -const CLASS_NAME_FADE = 'fade' -const CLASS_NAME_HIDE = 'hide' -const CLASS_NAME_SHOW = 'show' +const EVENT_HIDE = `hide${EVENT_KEY}` +const EVENT_HIDDEN = `hidden${EVENT_KEY}` +const EVENT_SHOW = `show${EVENT_KEY}` +const EVENT_SHOWN = `shown${EVENT_KEY}` + +const CLASS_NAME_FADE = 'fade' +const CLASS_NAME_HIDE = 'hide' +const CLASS_NAME_SHOW = 'show' const CLASS_NAME_SHOWING = 'showing' const DefaultType = { - animation : 'boolean', - autohide : 'boolean', - delay : 'number' + animation: 'boolean', + autohide: 'boolean', + delay: 'number' } const Default = { - animation : true, - autohide : true, - delay : 500 + animation: true, + autohide: true, + delay: 500 } const SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]' @@ -54,7 +54,7 @@ const SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]' class Toast { constructor(element, config) { this._element = element - this._config = this._getConfig(config) + this._config = this._getConfig(config) this._timeout = null this._setListeners() } @@ -142,7 +142,7 @@ class Toast { $.removeData(this._element, DATA_KEY) this._element = null - this._config = null + this._config = null } // Private @@ -195,8 +195,8 @@ class Toast { static _jQueryInterface(config) { return this.each(function () { const $element = $(this) - let data = $element.data(DATA_KEY) - const _config = typeof config === 'object' && config + let data = $element.data(DATA_KEY) + const _config = typeof config === 'object' && config if (!data) { data = new Toast(this, _config) @@ -220,9 +220,9 @@ class Toast { * ------------------------------------------------------------------------ */ -$.fn[NAME] = Toast._jQueryInterface +$.fn[NAME] = Toast._jQueryInterface $.fn[NAME].Constructor = Toast -$.fn[NAME].noConflict = () => { +$.fn[NAME].noConflict = () => { $.fn[NAME] = JQUERY_NO_CONFLICT return Toast._jQueryInterface } |