|
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 |
|
|
345 | 347 | floatingElement.parentNode.removeChild(floatingElement);
|
346 | 348 | }
|
347 | 349 |
|
| 350 | + //remove element overlay |
| 351 | + if (this._options.disableInteraction === true) { |
| 352 | + document.querySelector('.introjs-elementOverlay').remove(); |
| 353 | + } |
| 354 | + |
348 | 355 | //remove `introjs-showElement` class from the element
|
349 | 356 | var showElement = document.querySelector('.introjs-showElement');
|
350 | 357 | if (showElement) {
|
|
554 | 561 | //remove old classes
|
555 | 562 | var oldShowElement = document.querySelector('.introjs-showElement');
|
556 | 563 | oldShowElement.className = oldShowElement.className.replace(/introjs-[a-zA-Z]+/g, '').replace(/^\s+|\s+$/g, '');
|
| 564 | + |
| 565 | + //remove element overlay |
| 566 | + if (this._options.disableInteraction === true) { |
| 567 | + document.querySelector('.introjs-elementOverlay').remove(); |
| 568 | + } |
| 569 | + |
557 | 570 | //we should wait until the CSS3 transition is competed (it's 0.3 sec) to prevent incorrect `height` and `width` calculation
|
558 | 571 | if (self._lastShowElementTimer) {
|
559 | 572 | clearTimeout(self._lastShowElementTimer);
|
|
718 | 731 | //Set focus on "next" button, so that hitting Enter always moves you onto the next step
|
719 | 732 | nextTooltipButton.focus();
|
720 | 733 |
|
| 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 | + |
721 | 741 | //add target element position style
|
722 | 742 | targetElement.element.className += ' introjs-showElement';
|
723 | 743 |
|
|
0 commit comments