|
341 | 341 | helperLayer.parentNode.removeChild(helperLayer);
|
342 | 342 | }
|
343 | 343 |
|
| 344 | + //remove disableInteractionLayer |
| 345 | + var disableInteractionLayer = targetElement.querySelector('.introjs-disableInteraction'); |
| 346 | + if(disableInteractionLayer){ |
| 347 | + disableInteractionLayer.parentNode.removeChild(disableInteractionLayer); |
| 348 | + } |
| 349 | + |
344 | 350 | //remove intro floating element
|
345 | 351 | var floatingElement = document.querySelector('.introjsFloatingElement');
|
346 | 352 | if (floatingElement) {
|
347 | 353 | floatingElement.parentNode.removeChild(floatingElement);
|
348 | 354 | }
|
349 | 355 |
|
350 |
| - //remove element overlay |
351 |
| - if (this._options.disableInteraction === true) { |
352 |
| - document.querySelector('.introjs-elementOverlay').remove(); |
353 |
| - } |
354 |
| - |
355 | 356 | //remove `introjs-showElement` class from the element
|
356 | 357 | var showElement = document.querySelector('.introjs-showElement');
|
357 | 358 | if (showElement) {
|
|
510 | 511 | }
|
511 | 512 | }
|
512 | 513 |
|
| 514 | + function _disableInteraction(){ |
| 515 | + disableInteractionLayer = document.querySelector('.introjs-disableInteraction'); |
| 516 | + if (disableInteractionLayer === null){ |
| 517 | + disableInteractionLayer = document.createElement('div'); |
| 518 | + disableInteractionLayer.className = 'introjs-disableInteraction'; |
| 519 | + this._targetElement.appendChild(disableInteractionLayer); |
| 520 | + } |
| 521 | + _setHelperLayerPosition.call(this, disableInteractionLayer); |
| 522 | + |
| 523 | + } |
513 | 524 | /**
|
514 | 525 | * Show an element on the page
|
515 | 526 | *
|
|
562 | 573 | var oldShowElement = document.querySelector('.introjs-showElement');
|
563 | 574 | oldShowElement.className = oldShowElement.className.replace(/introjs-[a-zA-Z]+/g, '').replace(/^\s+|\s+$/g, '');
|
564 | 575 |
|
565 |
| - //remove element overlay |
566 |
| - if (this._options.disableInteraction === true) { |
567 |
| - document.querySelector('.introjs-elementOverlay').remove(); |
568 |
| - } |
569 |
| - |
570 | 576 | //we should wait until the CSS3 transition is competed (it's 0.3 sec) to prevent incorrect `height` and `width` calculation
|
571 | 577 | if (self._lastShowElementTimer) {
|
572 | 578 | clearTimeout(self._lastShowElementTimer);
|
|
617 | 623 | bulletsLayer.style.display = 'none';
|
618 | 624 | }
|
619 | 625 |
|
| 626 | + |
620 | 627 | var ulContainer = document.createElement('ul');
|
621 | 628 |
|
622 | 629 | for (var i = 0, stepsLength = this._introItems.length; i < stepsLength; i++) {
|
|
655 | 662 | helperNumberLayer.innerHTML = targetElement.step;
|
656 | 663 | helperLayer.appendChild(helperNumberLayer);
|
657 | 664 | }
|
| 665 | + |
658 | 666 | tooltipLayer.appendChild(arrowLayer);
|
659 | 667 | helperLayer.appendChild(tooltipLayer);
|
660 | 668 |
|
|
714 | 722 | _placeTooltip.call(self, targetElement.element, tooltipLayer, arrowLayer, helperNumberLayer);
|
715 | 723 | }
|
716 | 724 |
|
| 725 | + //disable interaction |
| 726 | + if (this._options.disableInteraction === true){ |
| 727 | + _disableInteraction.call(self); |
| 728 | + } |
717 | 729 | if (this._currentStep == 0 && this._introItems.length > 1) {
|
718 | 730 | prevTooltipButton.className = 'introjs-button introjs-prevbutton introjs-disabled';
|
719 | 731 | nextTooltipButton.className = 'introjs-button introjs-nextbutton';
|
|
731 | 743 | //Set focus on "next" button, so that hitting Enter always moves you onto the next step
|
732 | 744 | nextTooltipButton.focus();
|
733 | 745 |
|
734 |
| - //add inner div to prevent posibility interact with element (transparent overlay) |
735 |
| - if (this._options.disableInteraction === true) { |
736 |
| - var elementOverlay = document.createElement('div'); |
737 |
| - elementOverlay.className = 'introjs-elementOverlay'; |
738 |
| - targetElement.element.appendChild(elementOverlay); |
739 |
| - } |
740 |
| - |
741 | 746 | //add target element position style
|
742 | 747 | targetElement.element.className += ' introjs-showElement';
|
743 | 748 |
|
|
0 commit comments