@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
1 lines • 2.82 kB
JavaScript
module.exports=function(i){var o={};function n(e){if(o[e])return o[e].exports;var t=o[e]={exports:{},id:e,loaded:!1};return i[e].call(t.exports,t,t.exports,n),t.loaded=!0,t.exports}return n.m=i,n.c=o,n.p="",n(0)}({0:function(e,t,i){e.exports=i(1353)},3:function(e,t){e.exports=function(){throw Error("define cannot be used indirect")}},1335:function(e,t){e.exports=require("./kendo.mobile.popover")},1337:function(e,t){e.exports=require("./kendo.mobile.shim")},1353:function(e,t,i){var o;i(3),i=[i(1335),i(1337)],void 0===(t="function"==typeof(o=function(){var e={id:"mobile.actionsheet",name:"ActionSheet",category:"mobile",description:"The mobile ActionSheet widget displays a set of choices related to a task the user initiates.",depends:["mobile.popover","mobile.shim"]},a=window.kendo.jQuery,i=void 0,c=window.kendo,l=c.support,p=c.mobile.ui,m=p.Shim,f=p.Popup,d=p.Widget,o="open",t="close",s="command",h="li>a",n="actionsheetContext",x='<div class="km-actionsheet-wrapper"></div>',u=c.template('<li class="km-actionsheet-cancel"><a href="\\#">#:cancel#</a></li>'),r=d.extend({init:function(e,t){var i=this,o,n,s,r=l.mobileOS;d.fn.init.call(i,e,t);t=i.options;s=t.type;e=i.element;if(s==="auto")n=r&&r.tablet;else n=s==="tablet";o=n?f:m;if(t.cancelTemplate)u=c.template(t.cancelTemplate);e.addClass("km-actionsheet").append(u({cancel:i.options.cancel})).wrap(x).on("up",h,"_click").on("click",h,c.preventDefault);i.view().bind("destroy",function(){i.destroy()});i.wrapper=e.parent().addClass(s?" km-actionsheet-"+s:"");i.shim=new o(i.wrapper,a.extend({modal:r.ios&&r.majorVersion<7,className:"km-actionsheet-root"},i.options.popup));i._closeProxy=i._close.bind(i);i._shimHideProxy=i._shimHide.bind(i);i.shim.bind("hide",i._shimHideProxy);if(n)c.onResize(i._closeProxy);c.notify(i,p)},events:[o,t,s],options:{name:"ActionSheet",cancel:"Cancel",type:"auto",popup:{height:"auto"}},open:function(e,t){var i=this;i.target=a(e);i.context=t;i.shim.show(e)},close:function(){this.context=this.target=null;this.shim.hide()},openFor:function(e){var t=this,i=e.data(n);t.open(e,i);t.trigger(o,{target:e,context:i})},destroy:function(){d.fn.destroy.call(this);c.unbindResize(this._closeProxy);this.shim.destroy()},_click:function(e){if(e.isDefaultPrevented())return;var t=a(e.currentTarget);var i=t.data("action");if(i){var o={target:this.target,context:this.context},n=this.options.$angular;if(n)this.element.injector().get("$parse")(i)(n[0])(o);else c.getter(i)(window)(o)}this.trigger(s,{target:this.target,context:this.context,currentTarget:t});e.preventDefault();this._close()},_shimHide:function(e){if(!this.trigger(t))this.context=this.target=null;else e.preventDefault()},_close:function(e){if(!this.trigger(t))this.close();else e.preventDefault()}});return p.plugin(r),window.kendo})?o.apply(t,i):o)||(e.exports=t)}});