|
33 | 33 | nextLabel: 'Next →',
|
34 | 34 | prevLabel: '← Back',
|
35 | 35 | skipLabel: 'Skip',
|
| 36 | + doneLabel: 'Done', |
36 | 37 | tooltipPosition: 'bottom'
|
37 | 38 | };
|
38 | 39 | }
|
|
264 | 265 | var oldHelperNumberLayer = oldHelperLayer.querySelector('.introjs-helperNumberLayer'),
|
265 | 266 | oldtooltipLayer = oldHelperLayer.querySelector('.introjs-tooltiptext'),
|
266 | 267 | oldArrowLayer = oldHelperLayer.querySelector('.introjs-arrow'),
|
267 |
| - oldtooltipContainer = oldHelperLayer.querySelector('.introjs-tooltip'); |
| 268 | + oldtooltipContainer = oldHelperLayer.querySelector('.introjs-tooltip'), |
| 269 | + skipTooltipButton = oldHelperLayer.querySelector('.introjs-skipbutton'), |
| 270 | + prevTooltipButton = oldHelperLayer.querySelector('.introjs-prevbutton'), |
| 271 | + nextTooltipButton = oldHelperLayer.querySelector('.introjs-nextbutton'); |
268 | 272 |
|
269 | 273 | //hide the tooltip
|
270 | 274 | oldtooltipContainer.style.opacity = 0;
|
|
326 | 330 | _nextStep.call(self);
|
327 | 331 | };
|
328 | 332 |
|
329 |
| - nextTooltipButton.className = 'introjs-button introjs-nextbutton'; |
330 | 333 | nextTooltipButton.href = 'javascript:void(0);';
|
331 | 334 | nextTooltipButton.innerHTML = this._options.nextLabel;
|
332 | 335 |
|
|
337 | 340 | _previousStep.call(self);
|
338 | 341 | };
|
339 | 342 |
|
340 |
| - prevTooltipButton.className = 'introjs-button introjs-prevbutton'; |
341 | 343 | prevTooltipButton.href = 'javascript:void(0);';
|
342 | 344 | prevTooltipButton.innerHTML = this._options.prevLabel;
|
343 | 345 |
|
|
360 | 362 | _placeTooltip.call(self, targetElement, tooltipLayer, arrowLayer);
|
361 | 363 | }
|
362 | 364 |
|
| 365 | + if (this._currentStep == 0) { |
| 366 | + prevTooltipButton.className = 'introjs-button introjs-prevbutton introjs-disabled'; |
| 367 | + nextTooltipButton.className = 'introjs-button introjs-nextbutton'; |
| 368 | + skipTooltipButton.innerHTML = this._options.skipLabel |
| 369 | + } else if (this._introItems.length - 1 == this._currentStep) { |
| 370 | + skipTooltipButton.innerHTML = this._options.doneLabel |
| 371 | + prevTooltipButton.className = 'introjs-button introjs-prevbutton'; |
| 372 | + nextTooltipButton.className = 'introjs-button introjs-nextbutton introjs-disabled'; |
| 373 | + } else { |
| 374 | + prevTooltipButton.className = 'introjs-button introjs-prevbutton'; |
| 375 | + nextTooltipButton.className = 'introjs-button introjs-nextbutton'; |
| 376 | + skipTooltipButton.innerHTML = this._options.skipLabel |
| 377 | + } |
| 378 | + |
363 | 379 | //add target element position style
|
364 | 380 | targetElement.className += ' introjs-showElement';
|
365 | 381 |
|
|
0 commit comments