| 116 | } |
| 117 | |
| 118 | public disable(forDestroy = false): void { |
| 119 | if (this.disabled === true) return; |
| 120 | super.disable(); |
| 121 | this.dragEls.forEach(dragEl => { |
| 122 | dragEl.removeEventListener('mousedown', this._mouseDown); |
| 123 | if (isTouch) { |
| 124 | dragEl.removeEventListener('touchstart', touchstart); |
| 125 | dragEl.removeEventListener('pointerdown', pointerdown); |
| 126 | } |
| 127 | }); |
| 128 | if (!forDestroy) this.el.classList.add('ui-draggable-disabled'); |
| 129 | } |
| 130 | |
| 131 | public destroy(): void { |
| 132 | if (this.dragTimeout) window.clearTimeout(this.dragTimeout); |