10 lines
2.9 KiB
JavaScript
10 lines
2.9 KiB
JavaScript
/*
|
|
* Kendo UI Complete v2013.3.1119 (http://kendoui.com)
|
|
* Copyright 2013 Telerik AD. All rights reserved.
|
|
*
|
|
* Kendo UI Complete commercial licenses may be obtained at
|
|
* https://www.kendoui.com/purchase/license-agreement/kendo-ui-complete-commercial.aspx
|
|
* If you do not own a commercial license, this file shall be governed by the trial license terms.
|
|
*/
|
|
!function(define){return define(["./kendo.core.min","./kendo.userevents.min"],function(){!function(t){var e=window.kendo,n=e.ui.Widget,i=t.proxy,a=Math.abs,o=20,r=e.Class.extend({init:function(n,i,o){o=t.extend({minXDelta:30,maxYDelta:20,maxDuration:1e3},o),new e.UserEvents(n,{surface:o.surface,allowSelection:!0,start:function(t){2*a(t.x.velocity)>=a(t.y.velocity)&&t.sender.capture()},move:function(t){var e=t.touch,n=t.event.timeStamp-e.startTime,r=e.x.initialDelta>0?"right":"left";a(e.x.initialDelta)>=o.minXDelta&&a(e.y.initialDelta)<o.maxYDelta&&n<o.maxDuration&&(i({direction:r,touch:e,target:e.target}),e.cancel())}})}}),u=n.extend({init:function(t,a){function o(t){return function(e){u._triggerTouch(t,e)}}function r(t){return function(e){u.trigger(t,{touches:e.touches,distance:e.distance,center:e.center,event:e.event})}}var u=this;n.fn.init.call(u,t,a),a=u.options,t=u.element,u.events=new e.UserEvents(t,{filter:a.filter,surface:a.surface,minHold:a.minHold,multiTouch:a.multiTouch,allowSelection:!0,press:o("touchstart"),hold:o("hold"),tap:i(u,"_tap"),gesturestart:r("gesturestart"),gesturechange:r("gesturechange"),gestureend:r("gestureend")}),a.enableSwipe?(u.events.bind("start",i(u,"_swipestart")),u.events.bind("move",i(u,"_swipemove"))):(u.events.bind("start",i(u,"_dragstart")),u.events.bind("move",o("drag")),u.events.bind("end",o("dragend"))),e.notify(u)},events:["touchstart","dragstart","drag","dragend","tap","doubletap","hold","swipe","gesturestart","gesturechange","gestureend"],options:{name:"Touch",surface:null,global:!1,multiTouch:!1,enableSwipe:!1,minXDelta:30,maxYDelta:20,maxDuration:1e3,minHold:800,doubleTapTimeout:800},_triggerTouch:function(t,e){this.trigger(t,{touch:e.touch,event:e.event})},_tap:function(t){var n=this,i=n.lastTap,a=t.touch;i&&a.endTime-i.endTime<n.options.doubleTapTimeout&&e.touchDelta(a,i).distance<o?(n._triggerTouch("doubletap",t),n.lastTap=null):(n._triggerTouch("tap",t),n.lastTap=a)},_dragstart:function(t){this._triggerTouch("dragstart",t)},_swipestart:function(t){2*a(t.x.velocity)>=a(t.y.velocity)&&t.sender.capture()},_swipemove:function(t){var e=this,n=e.options,i=t.touch,o=t.event.timeStamp-i.startTime,r=i.x.initialDelta>0?"right":"left";a(i.x.initialDelta)>=n.minXDelta&&a(i.y.initialDelta)<n.maxYDelta&&o<n.maxDuration&&(e.trigger("swipe",{direction:r,touch:t.touch}),i.cancel())}});window.jQuery.fn.kendoMobileSwipe=function(t,e){this.each(function(){new r(this,t,e)})},e.ui.plugin(u)}(window.kendo.jQuery)})}("function"==typeof define&&define.amd?define:function(t,e){return e()});
|
|
//@ sourceMappingURL=kendo.touch.min.js.map
|