File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1470
1470
}
1471
1471
} ;
1472
1472
1473
+ /**
1474
+ * Removes all hint elements on the page
1475
+ * Useful when you want to destroy the elements and add them again (e.g. a modal or popup)
1476
+ *
1477
+ * @api private
1478
+ * @method _removeHints
1479
+ */
1480
+ function _removeHints ( ) {
1481
+ var hints = this . _targetElement . querySelectorAll ( '.introjs-hint' ) ;
1482
+
1483
+ if ( hints && hints . length > 0 ) {
1484
+ for ( var i = 0 ; i < hints . length ; i ++ ) {
1485
+ _removeHint . call ( this , hints [ i ] . getAttribute ( 'data-step' ) ) ;
1486
+ }
1487
+ }
1488
+ } ;
1489
+
1490
+ /**
1491
+ * Remove one single hint element from the page
1492
+ * Useful when you want to destroy the element and add them again (e.g. a modal or popup)
1493
+ * Use removeHints if you want to remove all elements.
1494
+ *
1495
+ * @api private
1496
+ * @method _removeHint
1497
+ */
1498
+ function _removeHint ( stepId ) {
1499
+ var hint = this . _targetElement . querySelector ( '.introjs-hint[data-step="' + stepId + '"]' ) ;
1500
+
1501
+ if ( hint ) {
1502
+ hint . parentNode . removeChild ( hint ) ;
1503
+ }
1504
+ } ;
1505
+
1473
1506
/**
1474
1507
* Add all available hints to the page
1475
1508
*
1917
1950
showHints : function ( ) {
1918
1951
_showHints . call ( this ) ;
1919
1952
return this ;
1953
+ } ,
1954
+ removeHints : function ( ) {
1955
+ _removeHints . call ( this ) ;
1956
+ return this ;
1957
+ } ,
1958
+ removeHint : function ( stepId ) {
1959
+ _removeHint . call ( this , stepId ) ;
1960
+ return this ;
1920
1961
}
1921
1962
} ;
1922
1963
You can’t perform that action at this time.
0 commit comments