10 lines
4.0 KiB
JavaScript
10 lines
4.0 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.mobile.application.min"],function(){!function(e){var i=window.kendo,t=i.mobile,n=i.support.mobileOS,s=i.effects.Transition,o=i.roleSelector,h="x",r=t.ui,a=!(n.ios&&7==n.majorVersion&&!n.appMode),l="beforeShow",d="init",u="show",v="hide",c=r.View.extend({init:function(n,s){var h,r,l;e(n).parent().prepend(n),t.ui.Widget.fn.init.call(this,n,s),this._layout(),this._scroller(),this._model(),this.pane=this.element.closest(o("pane")).data("kendoMobilePane"),h=this,this.pane.bind("viewShow",function(e){h._viewShow(e)}),this.pane.bind("sameViewRequested",function(){h.hide()}),r=function(e){h.visible&&(h.hide(),e.preventDefault())},l=this.userEvents=new i.UserEvents(this.pane.element,{filter:o("view"),allowSelection:!0}),this.options.swipeToOpen&&a?(l.bind("start",function(e){h._start(e)}),l.bind("move",function(e){h._update(e)}),l.bind("end",function(e){h._end(e)}),l.bind("tap",r)):l.bind("press",r),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(d)},options:{name:"Drawer",position:"left",views:[],swipeToOpen:!0,title:""},events:[l,v,d,u],show:function(){this._activate()&&this._show()},hide:function(){this._transitioning||(this.currentView.enable(),this.visible=!1,c.current=null,this._moveViewTo(0),this.trigger(v,{view:this}))},openFor:function(){this.visible?this.hide():this.show()},destroy:function(){r.View.fn.destroy.call(this),this.userEvents.destroy()},_activate:function(){if(this.visible)return!0;var e=this.options.views,i=this.pane.view(),t=!e[0]||this._viewsInclude(i.id.replace("#",""))||this._viewsInclude(i.element.attr("id"));return this.trigger(l,{view:this})||!t?!1:(this._setAsCurrent(),this.element.show(),this.trigger(u,{view:this}),!0)},_viewsInclude:function(e){return this.options.views.indexOf(e)>-1},_show:function(){if(!this._transitioning){this.currentView.enable(!1),this.visible=!0;var e=this.element.width();this.leftPositioned||(e=-e),this._moveViewTo(e)}},_setAsCurrent:function(){c.last!==this&&(c.last&&c.last.element.hide(),this.element.show()),c.last=this,c.current=this},_moveViewTo:function(e){this.userEvents.cancel(),this._transitioning=!0,this.transition.moveTo({location:e,duration:400,ease:s.easeOutExpo})},_viewShow:function(e){var t,n=this,o=this.movable,r=o&&o.x;return this.currentView&&this.currentView.enable(),this.currentView===e.view?(this.hide(),undefined):(this.currentView=e.view,t=e.view.element,o=this.movable=new i.ui.Movable(t),this.transition=new s({axis:h,movable:this.movable,onEnd:function(){n._transitioning=!1,0===o[h]&&(t[0].style.cssText="",n.element.hide())}}),r&&(this.movable.moveAxis(h,r),this.hide()),undefined)},_start:function(e){var t,n,s,o,h,r=e.sender;return Math.abs(e.x.velocity)<Math.abs(e.y.velocity)||i.triggeredByInput(e.event)?(r.cancel(),undefined):(t=this.leftPositioned,n=this.visible,s=t&&n||!t&&!c.current,o=!t&&n||t&&!c.current,h=e.x.velocity<0,(s&&h||o&&!h)&&this._activate()?(r.capture(),undefined):(r.cancel(),undefined))},_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(h,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()}});r.plugin(c)}(window.kendo.jQuery)})}("function"==typeof define&&define.amd?define:function(e,i){return i()});
|
|
//@ sourceMappingURL=kendo.mobile.drawer.min.js.map
|