Skip to content

Commit 403050a

Browse files
committed
don't overwrite options level with step level
1 parent a43ad85 commit 403050a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

intro.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
intro: currentElement.getAttribute('data-intro'),
133133
step: parseInt(currentElement.getAttribute('data-step'), 10),
134134
tooltipClass: currentElement.getAttribute('data-tooltipClass'),
135-
highlightClass: currentElement.getAttribute('data-highlightClass') || this._options.highlightClass,
135+
highlightClass: currentElement.getAttribute('data-highlightClass'),
136136
position: currentElement.getAttribute('data-position') || this._options.tooltipPosition
137137
};
138138
}
@@ -159,7 +159,7 @@
159159
intro: currentElement.getAttribute('data-intro'),
160160
step: nextStep + 1,
161161
tooltipClass: currentElement.getAttribute('data-tooltipClass'),
162-
highlightClass: currentElement.getAttribute('data-highlightClass') || this._options.highlightClass,
162+
highlightClass: currentElement.getAttribute('data-highlightClass'),
163163
position: currentElement.getAttribute('data-position') || this._options.tooltipPosition
164164
};
165165
}
@@ -662,9 +662,14 @@
662662
highlightClass = 'introjs-helperLayer',
663663
elementPosition = _getOffset(targetElement.element);
664664

665-
if (targetElement.highlightClass) {
665+
//check for a current step highlight class
666+
if (typeof (targetElement.highlightClass) === 'string') {
666667
highlightClass += (' ' + targetElement.highlightClass);
667668
}
669+
//check for options highlight class
670+
if (typeof (this._options.highlightClass) === 'string') {
671+
highlightClass += (' ' + this._options.highlightClass);
672+
}
668673

669674
if (oldHelperLayer != null) {
670675
var oldHelperNumberLayer = oldReferenceLayer.querySelector('.introjs-helperNumberLayer'),

0 commit comments

Comments
 (0)