Skip to content

Commit 8d417e5

Browse files
committed
hideHints to hide all hints. addresses: usablica#564 and usablica#587
1 parent 479fdc6 commit 8d417e5

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

intro.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,6 @@
12161216
function _removeHintTooltip() {
12171217
var tooltip = this._targetElement.querySelector('.introjs-hintReference');
12181218

1219-
12201219
if (tooltip) {
12211220
var step = tooltip.getAttribute('data-step');
12221221
tooltip.parentNode.removeChild(tooltip);
@@ -1320,6 +1319,22 @@
13201319
}
13211320
};
13221321

1322+
/**
1323+
* Hide all hints
1324+
*
1325+
* @api private
1326+
* @method _hideHints
1327+
*/
1328+
function _hideHints() {
1329+
var hints = this._targetElement.querySelectorAll('.introjs-hint');
1330+
1331+
if (hints && hints.length > 0) {
1332+
for (var i = 0; i < hints.length; i++) {
1333+
_hideHint.call(this, hints[i].getAttribute('data-step'));
1334+
}
1335+
}
1336+
};
1337+
13231338
/**
13241339
* Add all available hints to the page
13251340
*
@@ -1714,6 +1729,10 @@
17141729
hideHint: function (stepId) {
17151730
_hideHint.call(this, stepId);
17161731
return this;
1732+
},
1733+
hideHints: function () {
1734+
_hideHints.call(this);
1735+
return this;
17171736
}
17181737
};
17191738

0 commit comments

Comments
 (0)