-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue-finger.min.js
1 lines (1 loc) · 1.25 KB
/
vue-finger.min.js
1
!function(){function e(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}var n={},t="function"==typeof require?require("alloyfinger"):window.AlloyFinger,i={touchstart:"touchStart",touchmove:"touchMove",touchend:"touchEnd",touchcancel:"touchCancel",multipointstart:"multipointStart",multipointend:"multipointEnd",tap:"tap",doubletap:"doubleTap",longtap:"longTap",singletap:"singleTap",rotate:"rotate",pinch:"pinch",pressmove:"pressMove",swipe:"swipe"};if(!t)throw new Error("[vue-touch] cannot locate alloyfinger.");n.config={},n.install=function(n){n.directive("finger",{bind:function(n,o){var r,u,l=o.arg,a=o.value,f=Object.keys(i);if(l){if("function"!=typeof a)return void console.warn("[vue-finger] invalid handler function for v-finger: "+l+'="'+a);for(u=0;u<f.length;u++)if(0===l.indexOf(f[u])){r=i[f[u]];break}if(!r)return void console.warn("[vue-finger] invalid event type: "+l)}else console.warn("[vue-finger] event type argument is required.");n.alloyfinger?n.alloyfinger[r]=a:n.alloyfinger=new t(n,e({},r,a))},unbind:function(e){e.alloyfinger=null}})},"object"==typeof exports?module.exports=n:"function"==typeof define&&define.amd?define([],function(){return n}):window.Vue&&(window.VueFinger=n,Vue.use(n))}();