Skip to content

Commit 8ba2bc4

Browse files
davidlesieurjespirit
authored andcommitted
Fix wrong CSS class for tooltip visibility.
Bootstrap 4 uses 'show' instead of 'in'.
1 parent a974470 commit 8ba2bc4

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/js/bootstrap-slider.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1231,9 +1231,9 @@ const windowIsDefined = (typeof window === "object");
12311231
},
12321232
_hideTooltip: function() {
12331233
if (this._state.inDrag === false && this._alwaysShowTooltip !== true) {
1234-
this._removeClass(this.tooltip, 'in');
1235-
this._removeClass(this.tooltip_min, 'in');
1236-
this._removeClass(this.tooltip_max, 'in');
1234+
this._removeClass(this.tooltip, 'show');
1235+
this._removeClass(this.tooltip_min, 'show');
1236+
this._removeClass(this.tooltip_max, 'show');
12371237
}
12381238
this._state.over = false;
12391239
},

test/specs/TooltipMouseOverOptionSpec.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ describe("'ticks_tooltip' Option tests", function() {
7676
});
7777
var bigOffset = 100000;
7878

79-
var isTooltipVisible = $('#mySlider').find('.tooltip.tooltip-main').hasClass('in');
79+
var isTooltipVisible = $('#mySlider').find('.tooltip.tooltip-main').hasClass('show');
8080
expect(isTooltipVisible).toBe(true);
8181

8282
var mouseenter = document.createEvent('MouseEvent');
8383
mouseEventArguments[0] = 'mouseenter';
84-
mouseEventArguments[7] =
84+
mouseEventArguments[7] =
8585
testSlider.ticks[1].offsetLeft + testSlider.sliderElem.offsetLeft; // clientX
8686
mouseenter.initMouseEvent.apply(mouseenter, mouseEventArguments);
8787

@@ -91,7 +91,7 @@ describe("'ticks_tooltip' Option tests", function() {
9191
mouseleave.initMouseEvent.apply(mouseleave, mouseEventArguments);
9292

9393
testSlider.ticks[1].addEventListener('mouseleave', function() {
94-
isTooltipVisible = $('#mySlider').find('.tooltip.tooltip-main').hasClass('in');
94+
isTooltipVisible = $('#mySlider').find('.tooltip.tooltip-main').hasClass('show');
9595
expect(isTooltipVisible).toBe(true);
9696
done();
9797
});
@@ -294,7 +294,7 @@ describe("`ticks_tooltip: true` mouse navigation test cases", function() {
294294

295295
var tickCallback = function() {
296296
// Check that tooltip shows
297-
expect($tooltip.hasClass('in')).toBe(true);
297+
expect($tooltip.hasClass('show')).toBe(true);
298298

299299
if (index === lastTickIndex) {
300300
done();
@@ -314,7 +314,7 @@ describe("`ticks_tooltip: true` mouse navigation test cases", function() {
314314

315315
var tickCallback = function() {
316316
// Check that tooltip shows
317-
expect($tooltip.hasClass('in')).toBe(false);
317+
expect($tooltip.hasClass('show')).toBe(false);
318318

319319
if (index === lastTickIndex) {
320320
done();
@@ -442,4 +442,4 @@ describe("`ticks_tooltip: true` mouse navigation test cases", function() {
442442
});
443443
});
444444
});
445-
});
445+
});

0 commit comments

Comments
 (0)