(relatedTarget)
| 2768 | return this._isShown ? this.hide() : this.show(relatedTarget); |
| 2769 | } |
| 2770 | show(relatedTarget) { |
| 2771 | if (this._isShown) { |
| 2772 | return; |
| 2773 | } |
| 2774 | const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, { |
| 2775 | relatedTarget |
| 2776 | }); |
| 2777 | if (showEvent.defaultPrevented) { |
| 2778 | return; |
| 2779 | } |
| 2780 | this._isShown = true; |
| 2781 | this._backdrop.show(); |
| 2782 | if (!this._config.scroll) { |
| 2783 | new ScrollBarHelper().hide(); |
| 2784 | } |
| 2785 | this._element.setAttribute('aria-modal', true); |
| 2786 | this._element.setAttribute('role', 'dialog'); |
| 2787 | this._element.classList.add(CLASS_NAME_SHOWING$1); |
| 2788 | const completeCallBack = () => { |
| 2789 | if (!this._config.scroll || this._config.backdrop) { |
| 2790 | this._focustrap.activate(); |
| 2791 | } |
| 2792 | this._element.classList.add(CLASS_NAME_SHOW$3); |
| 2793 | this._element.classList.remove(CLASS_NAME_SHOWING$1); |
| 2794 | EventHandler.trigger(this._element, EVENT_SHOWN$3, { |
| 2795 | relatedTarget |
| 2796 | }); |
| 2797 | }; |
| 2798 | this._queueCallback(completeCallBack, this._element, true); |
| 2799 | } |
| 2800 | hide() { |
| 2801 | if (!this._isShown) { |
| 2802 | return; |
no test coverage detected