assets/javascripts/material/components/tab-switch.js in material-sass-4.1.0 vs assets/javascripts/material/components/tab-switch.js in material-sass-4.1.1
- old
+ new
@@ -1,8 +1,8 @@
/*
* Tab indicator animation
- * Requires Bootstrap's (v4.1.0) `tab.js`
+ * Requires Bootstrap's (v4.1.X) `tab.js`
*/
var TabSwitch = function ($) {
// constants >>>
var DATA_KEY = 'md.tabswitch';
var NAME = 'tabswitch';
@@ -39,11 +39,10 @@
var _this = this;
var navLeft = $(this._nav).offset().left;
var navScrollLeft = $(this._nav).scrollLeft();
var navWidth = $(this._nav).outerWidth();
- var supportsTransition = Util.supportsTransitionEnd();
if (!this._navindicator) {
this._createIndicator(navLeft, navScrollLeft, navWidth, relatedTarget);
}
@@ -53,28 +52,19 @@
var elLeft = $(element).offset().left;
var elWidth = $(element).outerWidth();
$(this._navindicator).addClass(ClassName.SHOW);
Util.reflow(this._navindicator);
-
- if (supportsTransition) {
- $(this._nav).addClass(ClassName.ANIMATE);
- }
-
+ $(this._nav).addClass(ClassName.ANIMATE);
$(this._navindicator).css({
left: elLeft + navScrollLeft - navLeft,
right: navWidth - (elLeft + navScrollLeft - navLeft + elWidth)
});
var complete = function complete() {
$(_this._nav).removeClass(ClassName.ANIMATE);
$(_this._navindicator).removeClass(ClassName.SHOW);
};
-
- if (!supportsTransition) {
- complete();
- return;
- }
var transitionDuration = Util.getTransitionDurationFromElement(this._navindicator);
$(this._navindicator).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
};