1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-10-05 17:51:44 +02:00

Comply to the new rules

This commit is contained in:
XhmikosR
2020-06-12 21:50:30 +03:00
parent 1c37a2ba77
commit 3be585990c
35 changed files with 606 additions and 574 deletions

View File

@@ -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 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_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
}