From e8f702666f285a3e69866ed1f8d29fa6eaaaeabb Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Wed, 13 Oct 2021 15:19:28 +0300 Subject: 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 --- js/src/toast.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'js/src/toast.js') diff --git a/js/src/toast.js b/js/src/toast.js index 780279be9..c45721c8f 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) -- cgit v1.2.3