Skip to content

Commit

Permalink
fixed: calling '.start()' before overlay fades out
Browse files Browse the repository at this point in the history
  • Loading branch information
fedosov committed Mar 16, 2013
1 parent 9db1de5 commit ea76102
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,20 @@
//for fade-out animation
overlayLayer.style.opacity = 0;
setTimeout(function () {
overlayLayer.parentNode.removeChild(overlayLayer);
if (overlayLayer.parentNode) {
overlayLayer.parentNode.removeChild(overlayLayer);
}
}, 500);
//remove all helper layers
var helperLayer = targetElement.querySelector(".introjs-helperLayer");
helperLayer.parentNode.removeChild(helperLayer);
if (helperLayer) {
helperLayer.parentNode.removeChild(helperLayer);
}
//remove `introjs-showElement` class from the element
var showElement = document.querySelector(".introjs-showElement");
showElement.className = showElement.className.replace(/introjs-showElement/,'').trim();
if (showElement) {
showElement.className = showElement.className.replace(/introjs-showElement/,'').trim();
}
//clean listeners
targetElement.onkeydown = null;
}
Expand Down

0 comments on commit ea76102

Please sign in to comment.