C_FastClick.js 2.3 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: hal
  3. // (C) Copyright IBM Corp. 2003, 2017.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. function C_FastClick(el, _h1P1){this._h0F2=el;this._h2P1=_h1P1;this._h0F2.addEventListener(G_BrowserInfo.M_bIsPointerEnabled?"MSPointerDown":"touchstart", this, false);};C_FastClick.prototype.F_Detach=function(){this._h0F2.removeEventListener(G_BrowserInfo.M_bIsPointerEnabled?"MSPointerDown":"touchstart", this, false);this._h0F2=null;this._h2P1=null;};C_FastClick.prototype.handleEvent=function(e){switch(e.type){case "MSPointerDown":case "touchstart":this._hA41(e);break;case "MSPointerMove":case "touchmove":this._hYA1(e);break;case "MSPointerUp":case "touchend":this._hYH1(e);break;case "MSPointerCancel":case "touchcancel":this._h062=true;this._hYH1(e);break;}};C_FastClick.prototype._hA41=function(e){this._h062=false;var _hP52=G_BrowserInfo.M_bIsPointerEnabled?e:e.targetTouches[0];this._hE02=_hP52.clientX;this._hF02=_hP52.clientY;this._hK41=document.elementFromPoint(this._hE02, this._hF02);this._h0F2.addEventListener(G_BrowserInfo.M_bIsPointerEnabled?"MSPointerMove":"touchmove", this, false);this._h0F2.addEventListener(G_BrowserInfo.M_bIsPointerEnabled?"MSPointerUp":"touchend", this, false);this._h0F2.addEventListener(G_BrowserInfo.M_bIsPointerEnabled?"MSPointerCancel":"touchcancel", this, false);};C_FastClick.prototype._hYA1=function(e){var _hP52=G_BrowserInfo.M_bIsPointerEnabled?e:e.targetTouches[0];if((Math.abs(_hP52.clientX-this._hE02)>=50)||(Math.abs(_hP52.clientY-this._hF02)>=50)){this._h062=true;}};C_FastClick.prototype._hYH1=function(e){if(!this._h062){var _hP52=G_BrowserInfo.M_bIsPointerEnabled?e:e.changedTouches[0];if(!this._hK41.contains(e.target)||(this._hK41!=document.elementFromPoint(_hP52.clientX, _hP52.clientY))){this._h062=true;}}this._h0F2.removeEventListener(G_BrowserInfo.M_bIsPointerEnabled?"MSPointerMove":"touchmove", this, false);this._h0F2.removeEventListener(G_BrowserInfo.M_bIsPointerEnabled?"MSPointerUp":"touchend", this, false);this._h0F2.removeEventListener(G_BrowserInfo.M_bIsPointerEnabled?"MSPointerCancel":"touchcancel", this, false);if(!this._h062){var _hP52=G_BrowserInfo.M_bIsPointerEnabled?e:e.changedTouches[0];this._h2P1(this._hK41, _hP52.clientX, _hP52.clientY);}this._hK41=null;};