|
57 | 57 | /* Scroll to highlighted element? */
|
58 | 58 | scrollToElement: true,
|
59 | 59 | /* Set the overlay opacity */
|
60 |
| - overlayOpacity: 0.8 |
| 60 | + overlayOpacity: 0.8, |
| 61 | + /* Disable an interaction with element? */ |
| 62 | + disableInteraction: false |
61 | 63 | };
|
62 | 64 | }
|
63 | 65 |
|
|
339 | 341 | helperLayer.parentNode.removeChild(helperLayer);
|
340 | 342 | }
|
341 | 343 |
|
| 344 | + //remove disableInteractionLayer |
| 345 | + var disableInteractionLayer = targetElement.querySelector('.introjs-disableInteraction'); |
| 346 | + if(disableInteractionLayer){ |
| 347 | + disableInteractionLayer.parentNode.removeChild(disableInteractionLayer); |
| 348 | + } |
| 349 | + |
342 | 350 | //remove intro floating element
|
343 | 351 | var floatingElement = document.querySelector('.introjsFloatingElement');
|
344 | 352 | if (floatingElement) {
|
|
503 | 511 | }
|
504 | 512 | }
|
505 | 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 | + } |
506 | 524 | /**
|
507 | 525 | * Show an element on the page
|
508 | 526 | *
|
|
554 | 572 | //remove old classes
|
555 | 573 | var oldShowElement = document.querySelector('.introjs-showElement');
|
556 | 574 | oldShowElement.className = oldShowElement.className.replace(/introjs-[a-zA-Z]+/g, '').replace(/^\s+|\s+$/g, '');
|
| 575 | + |
557 | 576 | //we should wait until the CSS3 transition is competed (it's 0.3 sec) to prevent incorrect `height` and `width` calculation
|
558 | 577 | if (self._lastShowElementTimer) {
|
559 | 578 | clearTimeout(self._lastShowElementTimer);
|
|
604 | 623 | bulletsLayer.style.display = 'none';
|
605 | 624 | }
|
606 | 625 |
|
| 626 | + |
607 | 627 | var ulContainer = document.createElement('ul');
|
608 | 628 |
|
609 | 629 | for (var i = 0, stepsLength = this._introItems.length; i < stepsLength; i++) {
|
|
642 | 662 | helperNumberLayer.innerHTML = targetElement.step;
|
643 | 663 | helperLayer.appendChild(helperNumberLayer);
|
644 | 664 | }
|
| 665 | + |
645 | 666 | tooltipLayer.appendChild(arrowLayer);
|
646 | 667 | helperLayer.appendChild(tooltipLayer);
|
647 | 668 |
|
|
701 | 722 | _placeTooltip.call(self, targetElement.element, tooltipLayer, arrowLayer, helperNumberLayer);
|
702 | 723 | }
|
703 | 724 |
|
| 725 | + //disable interaction |
| 726 | + if (this._options.disableInteraction === true){ |
| 727 | + _disableInteraction.call(self); |
| 728 | + } |
704 | 729 | if (this._currentStep == 0 && this._introItems.length > 1) {
|
705 | 730 | prevTooltipButton.className = 'introjs-button introjs-prevbutton introjs-disabled';
|
706 | 731 | nextTooltipButton.className = 'introjs-button introjs-nextbutton';
|
|
0 commit comments