angular-pressure
Version:
pressure.js support for Angular.js applications
8 lines • 1.57 kB
JavaScript
// ---- Angular Pressure ----
// Copyright (c) 2016
// Licensed under the MIT Software License
//
//
//
!function(a,b){"use strict";if("undefined"==typeof a)throw Error("angular-pressure: AngularJS (angular) is undefined but is necessary.");if("undefined"==typeof b)throw Error("angular-pressure: PressureJS (Pressure) is undefined but is necessary.");var c=[{directive:"psForceTouchStart",event:"start"},{directive:"psForceTouchEnd",event:"end"},{directive:"psForceTouch",event:"change"},{directive:"psForceTouchStartDeepPress",event:"startDeepPress"},{directive:"psForceTouchEndDeepPress",event:"endDeepPress"},{directive:"psForceTouchUnsupported",event:"unsupported"}],d="psForceTouchEvents",e=a.module("psForceTouchEvents",[]);e.provider(d,function(){var a=this;a.$get=function(){return{}}}),a.forEach(c,function(c){e.directive(c.directive,["$parse","$window",d,function(e,f,g){return{restrict:"A",scope:!1,compile:function(g,h){if(!b||!f.addEventListener)throw Error(d+": window.Pressure or window.addEventListener not found, can't add event "+c.directive);var i=e(h[c.directive],null,!0);return function(d,e){var f={},j={},k={polyfill:!0};if(f[c.event]=function(){var a={};switch(arguments.length){case 2:arguments[1].element=g,a={force:arguments[0],$event:arguments[1]};break;case 1:arguments[0].element=g,a={$event:arguments[0]}}var b=function(){i(d,a)};d.$apply(b)},h.psForceTouchOptions)var j=d.$eval(h.psForceTouchOptions);j=a.extend(k,j),a.forEach(e,function(a){b.set(a,f,j)})}}}}])})}(angular,Pressure);
//# sourceMappingURL=angular.pressure.min.js.map