Skip to content
Snippets Groups Projects
Commit f07fa017 authored by Jay Agrawal's avatar Jay Agrawal Committed by GitHub
Browse files

Added support for touchPunchDelay property

parent d672fd55
No related branches found
No related tags found
No related merge requests found
......@@ -8,4 +8,4 @@
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
\ No newline at end of file
!function(t){function o(t){t.preventDefault(),t.stopPropagation()}function e(t,o){if(!(t.originalEvent.touches.length>1)){t.preventDefault();var e=t.originalEvent.changedTouches[0],u=document.createEvent("MouseEvents");u.initMouseEvent(o,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(u)}}if(t.support.touch="ontouchend"in document,t.support.touch){var u,n=t.ui.mouse.prototype,c=n._mouseInit,i=n._mouseDestroy;n._touchStart=function(t){var n=this;!u&&n._mouseCapture(t.originalEvent.changedTouches[0])&&(n._touchMoved=!1,window.addEventListener("contextmenu",o),n._touchStartTimeout=setTimeout(function(){u=!0,n._touchStartTimeout=null,n._touchMoved||(e(t,"mouseover"),e(t,"mousemove"),e(t,"mousedown"))},window.touchPunchDelay))},n._touchMove=function(t){this._touchMoved=!0,u&&e(t,"mousemove")},n._touchEnd=function(t){this._touchStartTimeout&&(clearTimeout(this._touchStartTimeout),this._touchStartTimeout=null),window.removeEventListener("contextmenu",o),u&&(e(t,"mouseup"),e(t,"mouseout"),this._touchMoved||e(t,"click"),u=!1)},n._mouseInit=function(){var o=this;o.element.bind({touchstart:t.proxy(o,"_touchStart"),touchmove:t.proxy(o,"_touchMove"),touchend:t.proxy(o,"_touchEnd")}),c.call(o)},n._mouseDestroy=function(){var o=this;o.element.unbind({touchstart:t.proxy(o,"_touchStart"),touchmove:t.proxy(o,"_touchMove"),touchend:t.proxy(o,"_touchEnd")}),i.call(o)}}}(jQuery);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment