0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-03-04 02:02:39 -05:00
verdaccio/node_modules/onclick/dist/onClick.min.js
2014-09-14 18:28:17 +04:00

2 lines
No EOL
2.5 KiB
JavaScript

!function(a){if("object"==typeof exports)module.exports=a();else if("function"==typeof define&&define.amd)define(a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self),b.onClick=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};a[g][0].call(j.exports,function(b){var c=a[g][1][b];return e(c?c:b)},j,j.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(b,c){(function(b){!function(b){var d={selector:b.jQuery||b.Zepto||b.ender||b.$,template:b.Handlebars||b.Mustache};"function"==typeof a&&a.amd?a([],function(){return d}):"undefined"!=typeof c.exports?c.exports=d:b.unopinionate=d}("undefined"!=typeof window?window:b)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(a,b){var c=a("unopinionate").selector,d=c(document),e={},f=function(a){return f.bind(a),f};f.distanceLimit=10,f.timeLimit=140,f.isTouch="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch;var g=function(a){var b=c(this),d=(new Date).getTime(),g=f._getPos(a);b.one("touchend",function(a){a.preventDefault();var h=(new Date).getTime()-d,i=f._getPos(a),j=Math.sqrt(Math.pow(i.x-g.x,2)+Math.pow(i.y-g.y,2));h<f.timeLimit&&j<f.distanceLimit&&c.each(e,function(c,d){return b.is(c)?(d.apply(a.target,[a]),!1):void 0})})};f.bind=function(a){return c.isPlainObject(a)||(newEvents={},newEvents[arguments[0]]=arguments[1],a=newEvents),c.each(a,function(a,b){"undefined"!=typeof e[a]&&f.unbind(a),e[a]=b,f.isTouch&&d.delegate(a,"touchstart",g),d.delegate(a,"click",b)}),this},f.unbind=function(a){return d.undelegate(a,"touchstart").undelegate(a,"click"),delete e[a],this},f.unbindAll=function(){return c.each(e,function(a){d.undelegate(a,"touchstart").undelegate(a,"click")}),e={},this},f.trigger=function(a,b){return b=b||c.Event("click"),"undefined"!=typeof e[a]?e[a](b):console.error("No click events bound for selector '"+a+"'."),this},f._getPos=function(a){return a=a.originalEvent,a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:a.changedTouches?{x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY}:{x:a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,y:a.clientY+document.body.scrollTop+document.documentElement.scrollTop}},b.exports=f},{unopinionate:1}]},{},[2])(2)});
//# sourceMappingURL=onClick.min.map