mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-30 15:29:06 +02:00
JS: minor refactoring (#35183)
* add missing comments * shorten block comments * reorder constants * reorder public/private methods * sort exports alphabetically in util/index.js * fix a couple of typos
This commit is contained in:
@@ -16,9 +16,7 @@ import BaseComponent from './base-component'
|
||||
import { enableDismissTrigger } from './util/component-functions'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const NAME = 'toast'
|
||||
@@ -52,9 +50,7 @@ const Default = {
|
||||
}
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Class Definition
|
||||
* ------------------------------------------------------------------------
|
||||
* Class definition
|
||||
*/
|
||||
|
||||
class Toast extends BaseComponent {
|
||||
@@ -69,7 +65,6 @@ class Toast extends BaseComponent {
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
static get DefaultType() {
|
||||
return DefaultType
|
||||
}
|
||||
@@ -83,7 +78,6 @@ class Toast extends BaseComponent {
|
||||
}
|
||||
|
||||
// Public
|
||||
|
||||
show() {
|
||||
const showEvent = EventHandler.trigger(this._element, EVENT_SHOW)
|
||||
|
||||
@@ -145,7 +139,6 @@ class Toast extends BaseComponent {
|
||||
}
|
||||
|
||||
// Private
|
||||
|
||||
_getConfig(config) {
|
||||
config = {
|
||||
...Default,
|
||||
@@ -212,7 +205,6 @@ class Toast extends BaseComponent {
|
||||
}
|
||||
|
||||
// Static
|
||||
|
||||
static jQueryInterface(config) {
|
||||
return this.each(function () {
|
||||
const data = Toast.getOrCreateInstance(this, config)
|
||||
@@ -228,13 +220,14 @@ class Toast extends BaseComponent {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Data API implementation
|
||||
*/
|
||||
|
||||
enableDismissTrigger(Toast)
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* jQuery
|
||||
* ------------------------------------------------------------------------
|
||||
* add .Toast to jQuery only if jQuery is present
|
||||
*/
|
||||
|
||||
defineJQueryPlugin(Toast)
|
||||
|
Reference in New Issue
Block a user