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/dropdown.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/dropdown.js')
-rw-r--r--js/src/dropdown.js18
1 files changed, 2 insertions, 16 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js
index 360808eca0..6129707e26 100644
--- a/js/src/dropdown.js
+++ b/js/src/dropdown.js
@@ -6,7 +6,6 @@
*/
import * as Popper from '@popperjs/core'
-
import {
defineJQueryPlugin,
getElement,
@@ -25,9 +24,7 @@ import SelectorEngine from './dom/selector-engine'
import BaseComponent from './base-component'
/**
- * ------------------------------------------------------------------------
* Constants
- * ------------------------------------------------------------------------
*/
const NAME = 'dropdown'
@@ -89,9 +86,7 @@ const DefaultType = {
}
/**
- * ------------------------------------------------------------------------
- * Class Definition
- * ------------------------------------------------------------------------
+ * Class definition
*/
class Dropdown extends BaseComponent {
@@ -105,7 +100,6 @@ class Dropdown extends BaseComponent {
}
// Getters
-
static get Default() {
return Default
}
@@ -119,7 +113,6 @@ class Dropdown extends BaseComponent {
}
// Public
-
toggle() {
return this._isShown() ? this.hide() : this.show()
}
@@ -193,7 +186,6 @@ class Dropdown extends BaseComponent {
}
// Private
-
_completeHide(relatedTarget) {
const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE, relatedTarget)
if (hideEvent.defaultPrevented) {
@@ -354,7 +346,6 @@ class Dropdown extends BaseComponent {
}
// Static
-
static jQueryInterface(config) {
return this.each(function () {
const data = Dropdown.getOrCreateInstance(this, config)
@@ -474,9 +465,7 @@ class Dropdown extends BaseComponent {
}
/**
- * ------------------------------------------------------------------------
- * Data Api implementation
- * ------------------------------------------------------------------------
+ * Data API implementation
*/
EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler)
@@ -489,10 +478,7 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (
})
/**
- * ------------------------------------------------------------------------
* jQuery
- * ------------------------------------------------------------------------
- * add .Dropdown to jQuery only if jQuery is present
*/
defineJQueryPlugin(Dropdown)