|
42 | 42 | tooltipPosition: 'bottom',
|
43 | 43 | /* Next CSS class for tooltip boxes */
|
44 | 44 | tooltipClass: '',
|
| 45 | + /* CSS class that is added to the helperLayer */ |
| 46 | + highlightClass: '', |
45 | 47 | /* Close introduction when pressing Escape button? */
|
46 | 48 | exitOnEsc: true,
|
47 | 49 | /* Close introduction when clicking on overlay layer? */
|
|
130 | 132 | intro: currentElement.getAttribute('data-intro'),
|
131 | 133 | step: parseInt(currentElement.getAttribute('data-step'), 10),
|
132 | 134 | tooltipClass: currentElement.getAttribute('data-tooltipClass'),
|
| 135 | + highlightClass: currentElement.getAttribute('data-highlightClass') || this._options.highlightClass, |
133 | 136 | position: currentElement.getAttribute('data-position') || this._options.tooltipPosition
|
134 | 137 | };
|
135 | 138 | }
|
|
156 | 159 | intro: currentElement.getAttribute('data-intro'),
|
157 | 160 | step: nextStep + 1,
|
158 | 161 | tooltipClass: currentElement.getAttribute('data-tooltipClass'),
|
| 162 | + highlightClass: currentElement.getAttribute('data-highlightClass') || this._options.highlightClass, |
159 | 163 | position: currentElement.getAttribute('data-position') || this._options.tooltipPosition
|
160 | 164 | };
|
161 | 165 | }
|
|
515 | 519 | break;
|
516 | 520 | }
|
517 | 521 | }
|
518 |
| - |
| 522 | + |
519 | 523 | /**
|
520 | 524 | * Determines the position of the tooltip based on the position precedence and availability
|
521 | 525 | * of screen space.
|
|
655 | 659 | var self = this,
|
656 | 660 | oldHelperLayer = document.querySelector('.introjs-helperLayer'),
|
657 | 661 | oldReferenceLayer = document.querySelector('.introjs-tooltipReferenceLayer'),
|
| 662 | + highlightClass = 'introjs-helperLayer', |
658 | 663 | elementPosition = _getOffset(targetElement.element);
|
659 | 664 |
|
| 665 | + if (targetElement.highlightClass) { |
| 666 | + highlightClass += (' ' + targetElement.highlightClass); |
| 667 | + } |
| 668 | + |
660 | 669 | if (oldHelperLayer != null) {
|
661 | 670 | var oldHelperNumberLayer = oldReferenceLayer.querySelector('.introjs-helperNumberLayer'),
|
662 | 671 | oldtooltipLayer = oldReferenceLayer.querySelector('.introjs-tooltiptext'),
|
|
666 | 675 | prevTooltipButton = oldReferenceLayer.querySelector('.introjs-prevbutton'),
|
667 | 676 | nextTooltipButton = oldReferenceLayer.querySelector('.introjs-nextbutton');
|
668 | 677 |
|
| 678 | + //update or reset the helper highlight class |
| 679 | + oldHelperLayer.className = highlightClass; |
669 | 680 | //hide the tooltip
|
670 | 681 | oldtooltipContainer.style.opacity = 0;
|
671 | 682 | oldtooltipContainer.style.display = "none";
|
|
727 | 738 | bulletsLayer = document.createElement('div'),
|
728 | 739 | buttonsLayer = document.createElement('div');
|
729 | 740 |
|
730 |
| - helperLayer.className = 'introjs-helperLayer'; |
| 741 | + helperLayer.className = highlightClass; |
731 | 742 | referenceLayer.className = 'introjs-tooltipReferenceLayer';
|
732 | 743 |
|
733 | 744 | //set new position to helper layer
|
|
0 commit comments