1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-18 03:11:19 +02:00

Comply to the new rules.

This commit is contained in:
XhmikosR
2019-02-26 13:20:34 +02:00
parent 44e6abcba5
commit 46c037410b
44 changed files with 854 additions and 771 deletions

View File

@@ -22,40 +22,40 @@ import Manipulator from './dom/manipulator'
* ------------------------------------------------------------------------
*/
const NAME = 'toast'
const VERSION = '4.3.1'
const DATA_KEY = 'bs.toast'
const NAME = 'toast'
const VERSION = '4.3.1'
const DATA_KEY = 'bs.toast'
const EVENT_KEY = `.${DATA_KEY}`
const Event = {
CLICK_DISMISS : `click.dismiss${EVENT_KEY}`,
HIDE : `hide${EVENT_KEY}`,
HIDDEN : `hidden${EVENT_KEY}`,
SHOW : `show${EVENT_KEY}`,
SHOWN : `shown${EVENT_KEY}`
CLICK_DISMISS: `click.dismiss${EVENT_KEY}`,
HIDE: `hide${EVENT_KEY}`,
HIDDEN: `hidden${EVENT_KEY}`,
SHOW: `show${EVENT_KEY}`,
SHOWN: `shown${EVENT_KEY}`
}
const ClassName = {
FADE : 'fade',
HIDE : 'hide',
SHOW : 'show',
SHOWING : 'showing'
FADE: 'fade',
HIDE: 'hide',
SHOW: 'show',
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"]'
DATA_DISMISS: '[data-dismiss="toast"]'
}
/**
@@ -67,7 +67,7 @@ const Selector = {
class Toast {
constructor(element, config) {
this._element = element
this._config = this._getConfig(config)
this._config = this._getConfig(config)
this._timeout = null
this._setListeners()
Data.setData(element, DATA_KEY, this)
@@ -147,7 +147,7 @@ class Toast {
Data.removeData(this._element, DATA_KEY)
this._element = null
this._config = null
this._config = null
}
// Private
@@ -198,8 +198,8 @@ class Toast {
static _jQueryInterface(config) {
return this.each(function () {
let data = Data.getData(this, DATA_KEY)
const _config = typeof config === 'object' && config
let data = Data.getData(this, DATA_KEY)
const _config = typeof config === 'object' && config
if (!data) {
data = new Toast(this, _config)
@@ -229,9 +229,9 @@ class Toast {
if (typeof $ !== 'undefined') {
const JQUERY_NO_CONFLICT = $.fn[NAME]
$.fn[NAME] = Toast._jQueryInterface
$.fn[NAME].Constructor = Toast
$.fn[NAME].noConflict = () => {
$.fn[NAME] = Toast._jQueryInterface
$.fn[NAME].Constructor = Toast
$.fn[NAME].noConflict = () => {
$.fn[NAME] = JQUERY_NO_CONFLICT
return Toast._jQueryInterface
}