EOS/Scripts/kendo/2015.3.1111/kendo.mobile.popover.min.js
Nidhi Bhargava f0c1ab20e1 code push
2025-09-04 16:25:07 +05:30

9 lines
3.7 KiB
JavaScript

/*
* Kendo UI v2015.3.1111 (http://www.telerik.com/kendo-ui)
* Copyright 2015 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.popup.min","./kendo.mobile.pane.min"],e)}(function(){return function(e){var t=window.kendo,n=t.mobile,i=n.ui,o="hide",r="open",s="close",a='<div class="km-popup-wrapper" />',l='<div class="km-popup-arrow" />',c='<div class="km-popup-overlay" />',u="km-up km-down km-left km-right",d=i.Widget,h={down:{origin:"bottom center",position:"top center"},up:{origin:"top center",position:"bottom center"},left:{origin:"center left",position:"center right",collision:"fit flip"},right:{origin:"center right",position:"center left",collision:"fit flip"}},f={animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:400}}},p={horizontal:{offset:"top",size:"height"},vertical:{offset:"left",size:"width"}},g={up:"down",down:"up",left:"right",right:"left"},m=d.extend({init:function(n,i){var r,s,u=this,g=n.closest(".km-modalview-wrapper"),m=n.closest(".km-root").children(".km-pane").first(),v=g[0]?g:m;i.viewport?m=i.viewport:m[0]||(m=window),i.container?v=i.container:v[0]||(v=document.body),r={viewport:m,copyAnchorStyles:!1,autosize:!0,open:function(){u.overlay.show()},activate:e.proxy(u._activate,u),deactivate:function(){u.overlay.hide(),u._apiCall||u.trigger(o),u._apiCall=!1}},d.fn.init.call(u,n,i),n=u.element,i=u.options,n.wrap(a).addClass("km-popup").show(),s=u.options.direction.match(/left|right/)?"horizontal":"vertical",u.dimensions=p[s],u.wrapper=n.parent().css({width:i.width,height:i.height}).addClass("km-popup-wrapper km-"+i.direction).hide(),u.arrow=e(l).prependTo(u.wrapper).hide(),u.overlay=e(c).appendTo(v).hide(),r.appendTo=u.overlay,i.className&&u.overlay.addClass(i.className),u.popup=new t.ui.Popup(u.wrapper,e.extend(!0,r,f,h[i.direction]))},options:{name:"Popup",width:240,height:"",direction:"down",container:null,viewport:null},events:[o],show:function(t){this.popup.options.anchor=e(t),this.popup.open()},hide:function(){this._apiCall=!0,this.popup.close()},destroy:function(){d.fn.destroy.call(this),this.popup.destroy(),this.overlay.remove()},target:function(){return this.popup.options.anchor},_activate:function(){var t=this,n=t.options.direction,i=t.dimensions,o=i.offset,r=t.popup,s=r.options.anchor,a=e(s).offset(),l=e(r.element).offset(),c=r.flipped?g[n]:n,d=2*t.arrow[i.size](),h=t.element[i.size]()-t.arrow[i.size](),f=e(s)[i.size](),p=a[o]-l[o]+f/2;d>p&&(p=d),p>h&&(p=h),t.wrapper.removeClass(u).addClass("km-"+c),t.arrow.css(o,p).show()}}),v=d.extend({init:function(n,o){var r,a=this;a.initialOpen=!1,d.fn.init.call(a,n,o),r=e.extend({className:"km-popover-root",hide:function(){a.trigger(s)}},this.options.popup),a.popup=new m(a.element,r),a.popup.overlay.on("move",function(e){e.target==a.popup.overlay[0]&&e.preventDefault()}),a.pane=new i.Pane(a.element,e.extend(this.options.pane,{$angular:this.options.$angular})),t.notify(a,i)},options:{name:"PopOver",popup:{},pane:{}},events:[r,s],open:function(e){this.popup.show(e),this.initialOpen?this.pane.view()._invokeNgController():(this.pane.navigateToInitial()||this.pane.navigate(""),this.popup.popup._position(),this.initialOpen=!0)},openFor:function(e){this.open(e),this.trigger(r,{target:this.popup.target()})},close:function(){this.popup.hide()},destroy:function(){d.fn.destroy.call(this),this.pane.destroy(),this.popup.destroy(),t.destroy(this.element)}});i.plugin(m),i.plugin(v)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t){t()});