|
1777 | 1777 | this.focusElement(pointer); |
1778 | 1778 |
|
1779 | 1779 | ehMove = angular.bind(this, this.dragging.active ? this.onDragMove : this.onMove, pointer); |
1780 | | - ehEnd = angular.bind(this, this.onEnd, ehMove); |
1781 | | - |
1782 | | - $document.on(eventNames.moveEvent, ehMove); |
| 1780 | + ehEnd = angular.bind(this, this.onEnd, ehMove, ehEnd); |
1783 | 1781 |
|
| 1782 | + $document.on(eventNames.moveEvent, ehMove) |
1784 | 1783 | $document.on(eventNames.endEvent, ehEnd); |
1785 | | - this.ehEndToBeRemovedOnEnd = ehEnd; |
1786 | 1784 | this.callOnStart(); |
1787 | 1785 |
|
1788 | 1786 | var changedTouches = this.getEventAttr(event, 'changedTouches'); |
|
1842 | 1840 | * onEnd event handler |
1843 | 1841 | * |
1844 | 1842 | * @param {Event} event The event |
1845 | | - * @param {Function} ehMove The the bound move event handler |
| 1843 | + * @param {Function} ehMove The bound move event handler |
| 1844 | + * @param {Function} ehEnd The bound end event handler |
1846 | 1845 | * @returns {undefined} |
1847 | 1846 | */ |
1848 | | - onEnd: function(ehMove, event) { |
| 1847 | + onEnd: function(ehMove, ehEnd, event) { |
1849 | 1848 | var changedTouches = this.getEventAttr(event, 'changedTouches'); |
1850 | 1849 | if (changedTouches && changedTouches[0].identifier !== this.touchId) { |
1851 | 1850 | return; |
1852 | 1851 | } |
1853 | 1852 | this.isDragging = false; |
1854 | 1853 | this.touchId = null; |
1855 | 1854 |
|
1856 | | - // Touch event, the listener was added by us so we need to remove it |
1857 | | - $document.off("touchend", this.ehEndToBeRemovedOnEnd); |
1858 | | - |
1859 | | - var moveEventName = this.getEventNames(event).moveEvent; |
1860 | | - |
1861 | 1855 | if (!this.options.keyboardSupport) { |
1862 | 1856 | this.minH.removeClass('rz-active'); |
1863 | 1857 | this.maxH.removeClass('rz-active'); |
1864 | 1858 | this.tracking = ''; |
1865 | 1859 | } |
1866 | 1860 | this.dragging.active = false; |
1867 | 1861 |
|
1868 | | - $document.off(moveEventName, ehMove); |
| 1862 | + var eventName = this.getEventNames(event); |
| 1863 | + $document.off(eventName.moveEvent, ehMove); |
| 1864 | + $document.off(eventName.endEvent, ehEnd); |
1869 | 1865 | this.callOnEnd(); |
1870 | 1866 | }, |
1871 | 1867 |
|
|
0 commit comments