Skip to content

Commit 6e8a8cb

Browse files
committed
fixing done button conflict with skip button
1 parent c3b69ca commit 6e8a8cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

intro.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,9 @@
10261026
prevTooltipButton.removeAttribute('tabIndex');
10271027
nextTooltipButton.removeAttribute('tabIndex');
10281028

1029+
// when it's the first step of tour
10291030
if (this._currentStep == 0 && this._introItems.length > 1) {
1031+
skipTooltipButton.className = 'introjs-button introjs-skipbutton';
10301032
nextTooltipButton.className = 'introjs-button introjs-nextbutton';
10311033

10321034
if (this._options.hidePrev == true) {
@@ -1039,8 +1041,10 @@
10391041
prevTooltipButton.tabIndex = '-1';
10401042
skipTooltipButton.innerHTML = this._options.skipLabel;
10411043
} else if (this._introItems.length - 1 == this._currentStep || this._introItems.length == 1) {
1044+
// last step of tour
10421045
skipTooltipButton.innerHTML = this._options.doneLabel;
1043-
skipTooltipButton.className = 'introjs-button introjs-donebutton';
1046+
// adding donebutton class in addition to skipbutton
1047+
skipTooltipButton.className += ' introjs-donebutton';
10441048
prevTooltipButton.className = 'introjs-button introjs-prevbutton';
10451049

10461050
if (this._options.hideNext == true) {
@@ -1052,6 +1056,8 @@
10521056

10531057
nextTooltipButton.tabIndex = '-1';
10541058
} else {
1059+
// steps between start and end
1060+
skipTooltipButton.className = 'introjs-button introjs-skipbutton';
10551061
prevTooltipButton.className = 'introjs-button introjs-prevbutton';
10561062
nextTooltipButton.className = 'introjs-button introjs-nextbutton';
10571063
skipTooltipButton.innerHTML = this._options.skipLabel;

0 commit comments

Comments
 (0)