mirror of
https://github.com/YunoHost-Apps/webtrees_ynh.git
synced 2024-09-03 18:26:37 +02:00
1 line
No EOL
1.1 KiB
JavaScript
1 line
No EOL
1.1 KiB
JavaScript
!function(l){function a(f,m){if(!(1<f.originalEvent.touches.length)){f.preventDefault();var e=f.originalEvent.changedTouches[0],g=document.createEvent("MouseEvents");g.initMouseEvent(m,!0,!0,window,1,e.screenX,e.screenY,e.clientX,e.clientY,!1,!1,!1,!1,0,null);f.target.dispatchEvent(g)}}if(l.support.touch="ontouchend" in document,l.support.touch){var j,k=l.ui.mouse.prototype,i=k._mouseInit,h=k._mouseDestroy;k._touchStart=function(b){!j&&this._mouseCapture(b.originalEvent.changedTouches[0])&&(j=!0,this._touchMoved=!1,a(b,"mouseover"),a(b,"mousemove"),a(b,"mousedown"))};k._touchMove=function(b){j&&(this._touchMoved=!0,a(b,"mousemove"))};k._touchEnd=function(b){j&&(a(b,"mouseup"),a(b,"mouseout"),this._touchMoved||a(b,"click"),j=!1)};k._mouseInit=function(){this.element.bind({touchstart:l.proxy(this,"_touchStart"),touchmove:l.proxy(this,"_touchMove"),touchend:l.proxy(this,"_touchEnd")});i.call(this)};k._mouseDestroy=function(){this.element.unbind({touchstart:l.proxy(this,"_touchStart"),touchmove:l.proxy(this,"_touchMove"),touchend:l.proxy(this,"_touchEnd")});h.call(this)}}}(jQuery); |