diff options
author | Martijn Cuppens <martijn.cuppens@gmail.com> | 2018-03-13 11:59:20 +0300 |
---|---|---|
committer | Johann-S <johann.servoire@gmail.com> | 2018-03-13 11:59:20 +0300 |
commit | 1fadad1c33b99b94a4a821fe5c62c8064d129424 (patch) | |
tree | 8ea41f4bf03696e7718cc7c3e1216b7153b2fc85 /js/src/collapse.js | |
parent | 1859595cb6e1c92ba8134a7c12a087cb05f89688 (diff) |
Variable transition durations (#25662)
Diffstat (limited to 'js/src/collapse.js')
-rw-r--r-- | js/src/collapse.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/js/src/collapse.js b/js/src/collapse.js index 3f45d651da..ee357e37a6 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -21,7 +21,6 @@ const Collapse = (($) => { const EVENT_KEY = `.${DATA_KEY}` const DATA_API_KEY = '.data-api' const JQUERY_NO_CONFLICT = $.fn[NAME] - const TRANSITION_DURATION = 600 const Default = { toggle : true, @@ -190,10 +189,11 @@ const Collapse = (($) => { const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1) const scrollSize = `scroll${capitalizedDimension}` + const transitionDuration = Util.getTransitionDurationFromElement(this._element) $(this._element) .one(Util.TRANSITION_END, complete) - .emulateTransitionEnd(TRANSITION_DURATION) + .emulateTransitionEnd(transitionDuration) this._element.style[dimension] = `${this._element[scrollSize]}px` } @@ -252,9 +252,11 @@ const Collapse = (($) => { return } + const transitionDuration = Util.getTransitionDurationFromElement(this._element) + $(this._element) .one(Util.TRANSITION_END, complete) - .emulateTransitionEnd(TRANSITION_DURATION) + .emulateTransitionEnd(transitionDuration) } setTransitioning(isTransitioning) { |