aboutsummaryrefslogtreecommitdiff
path: root/js/src/util/index.js
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2021-10-13 15:19:28 +0300
committerGitHub <[email protected]>2021-10-13 15:19:28 +0300
commite8f702666f285a3e69866ed1f8d29fa6eaaaeabb (patch)
tree944b2dc894f49f8278d41d096e4388e9ac83157b /js/src/util/index.js
parentdb44392bda22f3d5319d2880c992f76d27d2a60c (diff)
downloadbootstrap-e8f702666f285a3e69866ed1f8d29fa6eaaaeabb.tar.xz
bootstrap-e8f702666f285a3e69866ed1f8d29fa6eaaaeabb.zip
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/util/index.js')
-rw-r--r--js/src/util/index.js36
1 files changed, 17 insertions, 19 deletions
diff --git a/js/src/util/index.js b/js/src/util/index.js
index 93f7223b1..0ba6ce6f8 100644
--- a/js/src/util/index.js
+++ b/js/src/util/index.js
@@ -19,9 +19,7 @@ const toType = obj => {
}
/**
- * --------------------------------------------------------------------------
- * Public Util Api
- * --------------------------------------------------------------------------
+ * Public Util API
*/
const getUID = prefix => {
@@ -113,7 +111,8 @@ const isElement = obj => {
}
const getElement = obj => {
- if (isElement(obj)) { // it's a jQuery object or a node element
+ // it's a jQuery object or a node element
+ if (isElement(obj)) {
return obj.jquery ? obj[0] : obj
}
@@ -196,8 +195,7 @@ const noop = () => {}
* @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation
*/
const reflow = element => {
- // eslint-disable-next-line no-unused-expressions
- element.offsetHeight
+ element.offsetHeight // eslint-disable-line no-unused-expressions
}
const getjQuery = () => {
@@ -312,24 +310,24 @@ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed
}
export {
+ defineJQueryPlugin,
+ execute,
+ executeAfterTransition,
+ findShadowRoot,
getElement,
- getUID,
- getSelectorFromElement,
getElementFromSelector,
+ getjQuery,
+ getNextActiveElement,
+ getSelectorFromElement,
getTransitionDurationFromElement,
- triggerTransitionEnd,
+ getUID,
+ isDisabled,
isElement,
- typeCheckConfig,
+ isRTL,
isVisible,
- isDisabled,
- findShadowRoot,
noop,
- getNextActiveElement,
- reflow,
- getjQuery,
onDOMContentLoaded,
- isRTL,
- defineJQueryPlugin,
- execute,
- executeAfterTransition
+ reflow,
+ triggerTransitionEnd,
+ typeCheckConfig
}