kopia lustrzana https://github.com/cyoung/stratux
2 wiersze
12 KiB
JavaScript
2 wiersze
12 KiB
JavaScript
![]() |
!function(){"use strict";angular.module("mobile-angular-ui.gestures.drag",["mobile-angular-ui.gestures.touch","mobile-angular-ui.gestures.transform"]).provider("$drag",function(){this.$get=["$touch","$transform",function(t,e){var n=document.createElement("style");n.appendChild(document.createTextNode("")),document.head.appendChild(n);var r=n.sheet;return r.insertRule("html .ui-drag-move{z-index: 99999 !important;}",0),r.insertRule("html .ui-drag-move{-webkit-transition: none !important;-moz-transition: none !important;-o-transition: none !important;-ms-transition: none !important;transition: none !important;}",0),r.insertRule("html .ui-drag-move, html .ui-drag-move *{-webkit-touch-callout: none !important;-webkit-user-select: none !important;-khtml-user-select: none !important;-moz-user-select: none !important;-ms-user-select: none !important;user-select: none !important;}",0),n=r=null,{NULL_TRANSFORM:function(t,e){return e},TRANSLATE_BOTH:function(t,e,n){return e.translateX=n.distanceX,e.translateY=n.distanceY,e},TRANSLATE_HORIZONTAL:function(t,e,n){return e.translateX=n.distanceX,e.translateY=0,e},TRANSLATE_UP:function(t,e,n){return e.translateY=n.distanceY<=0?n.distanceY:0,e.translateX=0,e},TRANSLATE_DOWN:function(t,e,n){return e.translateY=n.distanceY>=0?n.distanceY:0,e.translateX=0,e},TRANSLATE_LEFT:function(t,e,n){return e.translateX=n.distanceX<=0?n.distanceX:0,e.translateY=0,e},TRANSLATE_RIGHT:function(t,e,n){return e.translateX=n.distanceX>=0?n.distanceX:0,e.translateY=0,e},TRANSLATE_VERTICAL:function(t,e,n){return e.translateX=0,e.translateY=n.distanceY,e},TRANSLATE_INSIDE:function(t){return t=t.length?t[0]:t,function(e,n,r){e=e.length?e[0]:e;var a,o,i=e.getBoundingClientRect(),u=t instanceof Element?t.getBoundingClientRect():t;return a=i.width>=u.width?0:i.right+r.stepX>u.right?u.right-i.right:i.left+r.stepX<u.left?u.left-i.left:r.stepX,o=i.height>=u.height?0:i.bottom+r.stepY>u.bottom?u.bottom-i.bottom:i.top+r.stepY<u.top?u.top-i.top:r.stepY,n.translateX+=a,n.translateY+=o,n}},bind:function(n,r,a){n=angular.element(n),r=r||{},a=a||{};var o,i,u=r.start,s=r.end,c=r.move,l=r.cancel,f=r.transform||this.TRANSLATE_BOTH,v=n[0],m=e.get(n),d=v.getBoundingClientRect(),g=!1,h=function(){return g},p=function(){g=!1,o=i=null,n.removeClass("ui-drag-move")},X=function(){e.set(v,m)},Y=function(){e.set(v,o||m)},T=function(){g=!0,i=v.getBoundingClientRect(),o=e.get(v),n.addClass("ui-drag-move")},b=function(t){return t=angular.extend({},t),t.originalTransform=m,t.originalRect=d,t.startRect=i,t.rect=v.getBoundingClientRect(),t.startTransform=o,t.transform=e.get(v),t.reset=X,t.undo=Y,t},w=function(t,r){if(r.preventDefault(),h()){t=b(t);var a=f(n,angular.extend({},t.transform),t,r);e.set(v,a),c&&c(t,r)}else T(),u&&u(b(t),r)},R=function(t,e){h()&&(e.__UiSwipeHandled__=!0,t=b(t),p(),s&&s(t,e))},E=function(t,e){h()&&(t=b(t),Y(),p(),l&&l(t,e))};return t.bind(n,{move:w,end:R,cancel:E},a)}}}]})}(),function(){"use strict";var t=angular.module("mobile-angular-ui.gestures.swipe",["mobile-angular-ui.gestures.touch"]);t.factory("$swipe",["$touch",function(t){var e=500,n=10,r=10,a=10,o=Math.abs,i={movementThreshold:n,valid:function(t){var n=o(t.angle);n=n>=90?n-90:n;var i=t.total-t.distance<=r,u=a>=n||n>=90-a,s=t.averageVelocity>=e;return i&&u&&s}};return{bind:function(e,n,r){return r=angular.extend({},i,r||{}),t.bind(e,n,r)}}}]),angular.forEach(["ui","ng"],function(e){angular.forEach(["Left","Right"],function(n){var r=e+"Swipe"+n;t.directive(r,["$swipe","$parse",function(t,e){return{link:function(a,o,i){var u=e(i[r]);t.bind(o,{end:function(t,e){t.direction===n.toUpperCase()&&(e.__UiSwipeHandled__||(e.__UiSwipeHandled__=!0,a.$apply(function(){u(a,{$touch:t})})))}})}}}])})})}(),function(){"use strict";var t=angular.module("mobile-angular-ui.gestures.touch",[]);t.provider("$touch",function(){var t=function(){return!0},e=1,n={mouse:{start:"mousedown",move:"mousemove",end:"mouseup"},touch:{start:"touchstart",move:"touchmove",end:"touchend",cancel:"touchcancel"}},r=["mouse","touch"],a=function(t){return t[0].ownerDocument.documentElement.getBoundi
|
||
|
//# sourceMappingURL=mobile-angular-ui.gestures.min.js.map
|