1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-28 06:20:15 +02:00

some cleaning and changes for readability

This commit is contained in:
Johann-S
2018-11-14 10:16:56 +01:00
parent fab1dea927
commit 9201a80510
12 changed files with 285 additions and 296 deletions

View File

@@ -1,6 +1,3 @@
import $ from 'jquery'
import Util from './util'
/**
* --------------------------------------------------------------------------
* Bootstrap (v4.1.3): collapse.js
@@ -8,6 +5,9 @@ import Util from './util'
* --------------------------------------------------------------------------
*/
import $ from 'jquery'
import Util from './util'
/**
* ------------------------------------------------------------------------
* Constants
@@ -67,10 +67,11 @@ class Collapse {
this._isTransitioning = false
this._element = element
this._config = this._getConfig(config)
this._triggerArray = $.makeArray(document.querySelectorAll(
this._triggerArray = [].slice.call(document.querySelectorAll(
`[data-toggle="collapse"][href="#${element.id}"],` +
`[data-toggle="collapse"][data-target="#${element.id}"]`
))
const toggleList = [].slice.call(document.querySelectorAll(Selector.DATA_TOGGLE))
for (let i = 0, len = toggleList.length; i < len; i++) {
const elem = toggleList[i]
@@ -227,6 +228,7 @@ class Collapse {
for (let i = 0; i < triggerArrayLength; i++) {
const trigger = this._triggerArray[i]
const selector = Util.getSelectorFromElement(trigger)
if (selector !== null) {
const $elem = $([].slice.call(document.querySelectorAll(selector)))
if (!$elem.hasClass(ClassName.SHOW)) {
@@ -375,6 +377,7 @@ $(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
const $trigger = $(this)
const selector = Util.getSelectorFromElement(this)
const selectors = [].slice.call(document.querySelectorAll(selector))
$(selectors).each(function () {
const $target = $(this)
const data = $target.data(DATA_KEY)