demo20230512/Scripts/kendo/2014.2.716/kendo.mobile.actionsheet.min.js
2023-05-12 10:20:28 +08:00

16 lines
2.4 KiB
JavaScript

/**
* Copyright 2014 Telerik AD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
!function(e,define){define(["./kendo.mobile.popover.min","./kendo.mobile.shim.min"],e)}(function(){return function(e){var t=window.kendo,n=t.support,i=t.mobile.ui,r=i.Shim,o=i.Popup,a=i.Widget,s="open",l="close",u="command",c="li>a",d="actionsheetContext",p='<div class="km-actionsheet-wrapper" />',f=t.template('<li class="km-actionsheet-cancel"><a href="\\#">#:cancel#</a></li>'),h=a.extend({init:function(s,l){var u,d,h,g=this,m=n.mobileOS;a.fn.init.call(g,s,l),l=g.options,h=l.type,s=g.element,d="auto"===h?m&&m.tablet:"tablet"===h,u=d?o:r,l.cancelTemplate&&(f=t.template(l.cancelTemplate)),s.addClass("km-actionsheet").append(f({cancel:g.options.cancel})).wrap(p).on("up",c,"_click").on("click",c,t.preventDefault),g.view().bind("destroy",function(){g.destroy()}),g.wrapper=s.parent().addClass(h?" km-actionsheet-"+h:""),g.shim=new u(g.wrapper,e.extend({modal:m.ios&&7>m.majorVersion,className:"km-actionsheet-root"},g.options.popup)),g._closeProxy=e.proxy(g,"_close"),g.shim.bind("hide",g._closeProxy),d&&t.onResize(g._closeProxy),t.notify(g,i)},events:[s,l,u],options:{name:"ActionSheet",cancel:"Cancel",type:"auto",popup:{height:"auto"}},open:function(t,n){var i=this;i.target=e(t),i.context=n,i.shim.show(t)},close:function(){this.context=this.target=null,this.shim.hide()},openFor:function(e){var t=this,n=e.data(d);t.open(e,n),t.trigger(s,{target:e,context:n})},destroy:function(){a.fn.destroy.call(this),t.unbindResize(this._closeProxy),this.shim.destroy()},_click:function(n){var i,r;n.isDefaultPrevented()||(i=e(n.currentTarget),r=i.data("action"),r&&t.getter(r)(window)({target:this.target,context:this.context}),this.trigger(u,{target:this.target,context:this.context,currentTarget:i}),n.preventDefault(),this._close())},_close:function(){this.close(),this.trigger(l)}});i.plugin(h)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});