Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2021-10-13 15:19:28 +0300
committerGitHub <noreply@github.com>2021-10-13 15:19:28 +0300
commite8f702666f285a3e69866ed1f8d29fa6eaaaeabb (patch)
tree944b2dc894f49f8278d41d096e4388e9ac83157b /js/src/toast.js
parentdb44392bda22f3d5319d2880c992f76d27d2a60c (diff)
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
Diffstat (limited to 'js/src/toast.js')
-rw-r--r--js/src/toast.js17
1 files changed, 5 insertions, 12 deletions
diff --git a/js/src/toast.js b/js/src/toast.js
index 780279be97..c45721c8f8 100644
--- a/js/src/toast.js
+++ b/js/src/toast.js
@@ -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)