Skip to content

Commit 8791715

Browse files
author
Nathaniel Blackburn
committed
Added showHint and showHints
1 parent c57c061 commit 8791715

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

intro.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,36 @@
13651365
}
13661366
};
13671367

1368+
/**
1369+
* Show all hints
1370+
*
1371+
* @api private
1372+
* @method _showHints
1373+
*/
1374+
function _showHints() {
1375+
var hints = this._targetElement.querySelectorAll('.introjs-hint');
1376+
1377+
if (hints && hints.length > 0) {
1378+
for (var i = 0; i < hints.length; i++) {
1379+
_showHint.call(this, hints[i].getAttribute('data-step'));
1380+
}
1381+
}
1382+
};
1383+
1384+
/**
1385+
* Show a hint
1386+
*
1387+
* @api private
1388+
* @method _showHint
1389+
*/
1390+
function _showHint(stepId) {
1391+
var hint = this._targetElement.querySelector('.introjs-hint[data-step="' + stepId + '"]');
1392+
1393+
if (hint) {
1394+
hint.className = hint.className.replace('introjs-hidehint', '');
1395+
}
1396+
};
1397+
13681398
/**
13691399
* Add all available hints to the page
13701400
*
@@ -1767,6 +1797,14 @@
17671797
hideHints: function () {
17681798
_hideHints.call(this);
17691799
return this;
1800+
},
1801+
showHint: function (stepId) {
1802+
_showHint.call(this, stepId);
1803+
return this;
1804+
},
1805+
showHints: function () {
1806+
_showHints.call(this);
1807+
return this;
17701808
}
17711809
};
17721810

0 commit comments

Comments
 (0)