kendo.mobile.drawer.min.js 8.37 KB
/** 
 * Kendo UI v2016.1.112 (http://www.telerik.com/kendo-ui)                                                                                                                                               
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("kendo.mobile.drawer.min",["kendo.mobile.view.min","kendo.userevents.min"],e)}(function(){return function(e,i){var t=window.kendo,n=t.mobile,s=t.support.mobileOS,o=t.effects.Transition,r=t.roleSelector,a="x",h=n.ui,l=!(s.ios&&7==s.majorVersion&&!s.appMode),d="beforeShow",c="init",u="show",w="hide",v="afterHide",f={enable:e.noop},p=h.View.extend({init:function(i,s){var o,a,h,d,u;if(e(i).parent().prepend(i),n.ui.Widget.fn.init.call(this,i,s),this.options.$angular||(this._layout(),this._scroller()),this._model(),o=this.element.closest(r("pane")).data("kendoMobilePane"))this.pane=o,this.pane.bind("viewShow",function(e){d._viewShow(e)}),this.pane.bind("sameViewRequested",function(){d.hide()}),a=this.userEvents=new t.UserEvents(o.element,{fastTap:!0,filter:r("view splitview"),allowSelection:!0});else{if(this.currentView=f,h=e(this.options.container),!h)throw Error("The drawer needs a container configuration option set.");a=this.userEvents=new t.UserEvents(h,{fastTap:!0,allowSelection:!0}),this._attachTransition(h)}d=this,u=function(e){d.visible&&(d.hide(),e.preventDefault())},this.options.swipeToOpen&&l?(a.bind("press",function(){d.transition.cancel()}),a.bind("start",function(e){d._start(e)}),a.bind("move",function(e){d._update(e)}),a.bind("end",function(e){d._end(e)}),a.bind("tap",u)):a.bind("press",u),this.leftPositioned="left"===this.options.position,this.visible=!1,this.element.hide().addClass("km-drawer").addClass(this.leftPositioned?"km-left-drawer":"km-right-drawer"),this.trigger(c)},options:{name:"Drawer",position:"left",views:[],swipeToOpenViews:[],swipeToOpen:!0,title:"",container:null},events:[d,w,v,c,u],show:function(){this._activate()&&this._show()},hide:function(){this.currentView&&(this.currentView.enable(),p.current=null,this._moveViewTo(0),this.trigger(w,{view:this}))},openFor:function(){this.visible?this.hide():this.show()},destroy:function(){h.View.fn.destroy.call(this),this.userEvents.destroy()},_activate:function(){if(this.visible)return!0;var e=this._currentViewIncludedIn(this.options.views);return!e||this.trigger(d,{view:this})?!1:(this._setAsCurrent(),this.element.show(),this.trigger(u,{view:this}),this._invokeNgController(),!0)},_currentViewIncludedIn:function(i){if(!this.pane||!i.length)return!0;var t=this.pane.view();return e.inArray(t.id.replace("#",""),i)>-1||e.inArray(t.element.attr("id"),i)>-1},_show:function(){this.currentView.enable(!1),this.visible=!0;var e=this.element.width();this.leftPositioned||(e=-e),this._moveViewTo(e)},_setAsCurrent:function(){p.last!==this&&(p.last&&p.last.element.hide(),this.element.show()),p.last=this,p.current=this},_moveViewTo:function(e){this.userEvents.cancel(),this.transition.moveTo({location:e,duration:400,ease:o.easeOutExpo})},_viewShow:function(e){return this.currentView&&this.currentView.enable(),this.currentView===e.view?(this.hide(),i):(this.currentView=e.view,this._attachTransition(e.view.element),i)},_attachTransition:function(e){var i=this,n=this.movable,s=n&&n.x;this.transition&&(this.transition.cancel(),this.movable.moveAxis("x",0)),n=this.movable=new t.ui.Movable(e),this.transition=new o({axis:a,movable:this.movable,onEnd:function(){0===n[a]&&(e[0].style.cssText="",i.element.hide(),i.trigger(v),i.visible=!1)}}),s&&(e.addClass("k-fx-hidden"),t.animationFrame(function(){e.removeClass("k-fx-hidden"),i.movable.moveAxis(a,s),i.hide()}))},_start:function(e){var n,s,o,r,a,h=e.sender;return Math.abs(e.x.velocity)<Math.abs(e.y.velocity)||t.triggeredByInput(e.event)||!this._currentViewIncludedIn(this.options.swipeToOpenViews)?(h.cancel(),i):(n=this.leftPositioned,s=this.visible,o=n&&s||!n&&!p.current,r=!n&&s||n&&!p.current,a=0>e.x.velocity,(o&&a||r&&!a)&&this._activate()?(h.capture(),i):(h.cancel(),i))},_update:function(e){var i,t=this.movable,n=t.x+e.x.delta;i=this.leftPositioned?Math.min(Math.max(0,n),this.element.width()):Math.max(Math.min(0,n),-this.element.width()),this.movable.moveAxis(a,i),e.event.preventDefault(),e.event.stopPropagation()},_end:function(e){var i,t=e.x.velocity,n=Math.abs(this.movable.x)>this.element.width()/2,s=.8;i=this.leftPositioned?t>-s&&(t>s||n):s>t&&(-s>t||n),i?this._show():this.hide()}});h.plugin(p)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,i,t){(t||i)()});
//# sourceMappingURL=kendo.mobile.drawer.min.js.map