()
| 89 | } |
| 90 | |
| 91 | trapFocus () { |
| 92 | if (!this.trapsFocus) { return } |
| 93 | if (!this.focusTrap) { |
| 94 | this.focusTrap = focusTrap.createFocusTrap(this.el) |
| 95 | } |
| 96 | try { |
| 97 | this.focusTrap?.activate() |
| 98 | console.log(this.constructor?.name, 'trapping focus within modal') |
| 99 | } catch (e) { |
| 100 | console.log(this.constructor?.name, 'not trapping focus for modal with no focusable elements') |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | showLoading ($el) { |
| 105 | if (!$el) { $el = this.$el.find('.modal-body') } |