You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

jquery.ui.touch-punch.min.js 1.3KB

1234567891011
  1. /*!
  2. * jQuery UI Touch Punch 0.2.3
  3. *
  4. * Copyright 2011–2014, Dave Furfero
  5. * Dual licensed under the MIT or GPL Version 2 licenses.
  6. *
  7. * Depends:
  8. * jquery.ui.widget.js
  9. * jquery.ui.mouse.js
  10. */
  11. !function(a){function b(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 c,d=a.ui.mouse.prototype,e=d._mouseInit,f=d._mouseDestroy;d._touchStart=function(a){var d=this;!c&&d._mouseCapture(a.originalEvent.changedTouches[0])&&(c=!0,d._touchMoved=!1,b(a,"mouseover"),b(a,"mousemove"),b(a,"mousedown"))},d._touchMove=function(a){c&&(this._touchMoved=!0,b(a,"mousemove"))},d._touchEnd=function(a){c&&(b(a,"mouseup"),b(a,"mouseout"),this._touchMoved||b(a,"click"),c=!1)},d._mouseInit=function(){var b=this;b.element.bind({"touchstart":a.proxy(b,"_touchStart"),"touchmove":a.proxy(b,"_touchMove"),"touchend":a.proxy(b,"_touchEnd")}),e.call(b)},d._mouseDestroy=function(){var b=this;b.element.unbind({"touchstart":a.proxy(b,"_touchStart"),"touchmove":a.proxy(b,"_touchMove"),"touchend":a.proxy(b,"_touchEnd")}),f.call(b)}}}(jQuery);