@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
3 lines (2 loc) • 1.56 kB
JavaScript
!function(e){"function"==typeof define&&define.amd?define(["kendo.popup.min"],e):e()}((function(){var e,i,n,o,t,s,a,p;e=window.kendo.jQuery,n=window.kendo,o=n.mobile.ui,t=n.ui.Popup,s="hide",a=o.Widget,p=a.extend({init:function(i,o){var p=this,d=n.mobile.application,c=n.support.mobileOS,l=d?d.os.name:c?c.name:"ios",r="ios"===l||"wp"===l||!!d&&d.os.skin,h="blackberry"===l,u=o.align||(r?"bottom center":h?"center right":"center center"),m=o.position||(r?"bottom center":h?"center right":"center center"),f=o.effect||(r?"slideIn:up":h?"slideIn:left":"fade:in"),g=e('<div class="km-shim"></div>').handler(p).hide();a.fn.init.call(p,i,o),p.shim=g,i=p.element,(o=p.options).className&&p.shim.addClass(o.className),o.modal||p.shim.on("down","_hide"),(d?d.element:e(document.body)).append(g),p.popup=new t(p.element,{anchor:g,modal:!0,appendTo:g,origin:u,position:m,animation:{open:{effects:f,duration:o.duration},close:{duration:o.duration}},close:function(e){var i=!1;p._apiCall||(i=p.trigger(s)),i&&e.preventDefault(),p._apiCall=!1},deactivate:function(){g.hide()},open:function(){g.show()}}),n.notify(p)},events:[s],options:{name:"Shim",modal:!1,align:i,position:i,effect:i,duration:200},show:function(){this.popup.open()},hide:function(){this._apiCall=!0,this.popup.close()},destroy:function(){a.fn.destroy.call(this),this.shim.kendoDestroy(),this.popup.destroy(),this.shim.remove()},_hide:function(i){i&&e.contains(this.shim.children().children(".k-popup")[0],i.target)||this.popup.close()}}),o.plugin(p)}));
//# sourceMappingURL=kendo.mobile.shim.min.js.map