kendo.popup.min.js 11.9 KB
/** 
 * Kendo UI v2016.1.112 (http://www.telerik.com/kendo-ui)                                                                                                                                               
 * Copyright 2016 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.core.min"],e)}(function(){return function(e,t){function o(t,o){return t===o||e.contains(t,o)}var i=window.kendo,n=i.ui,s=n.Widget,r=i.support,a=i.getOffset,l="open",p="close",d="deactivate",c="activate",f="center",u="left",h="right",g="top",m="bottom",w="absolute",v="hidden",_="body",k="location",y="position",z="visible",b="effects",x="k-state-active",C="k-state-border",T=/k-state-border-(\w+)/,P=".k-picker-wrap, .k-dropdown-wrap, .k-link",E="down",S=e(document.documentElement),H=e(window),W="scroll",O=r.transitions.css,R=O+"transform",I=e.extend,A=".kendoPopup",D=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],L=s.extend({init:function(t,o){var n,a=this;o=o||{},o.isRtl&&(o.origin=o.origin||m+" "+h,o.position=o.position||g+" "+h),s.fn.init.call(a,t,o),t=a.element,o=a.options,a.collisions=o.collision?o.collision.split(" "):[],a.downEvent=i.applyEventMap(E,i.guid()),1===a.collisions.length&&a.collisions.push(a.collisions[0]),n=e(a.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])"),o.appendTo=e(e(o.appendTo)[0]||n[0]||_),a.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl",!!o.isRtl).css({position:w}).appendTo(o.appendTo).on("mouseenter"+A,function(){a._hovered=!0}).on("mouseleave"+A,function(){a._hovered=!1}),a.wrapper=e(),o.animation===!1&&(o.animation={open:{effects:{}},close:{hide:!0,effects:{}}}),I(o.animation.open,{complete:function(){a.wrapper.css({overflow:z}),a._activated=!0,a._trigger(c)}}),I(o.animation.close,{complete:function(){a._animationClose()}}),a._mousedownProxy=function(e){a._mousedown(e)},a._resizeProxy=r.mobileOS.android?function(e){setTimeout(function(){a._resize(e)},600)}:function(e){a._resize(e)},o.toggleTarget&&e(o.toggleTarget).on(o.toggleEvent+A,e.proxy(a.toggle,a))},events:[l,c,p,d],options:{name:"Popup",toggleEvent:"click",origin:m+" "+u,position:g+" "+u,anchor:_,appendTo:null,collision:"flip fit",viewport:window,copyAnchorStyles:!0,autosize:!1,modal:!1,adjustSize:{width:0,height:0},animation:{open:{effects:"slideIn:down",transition:!0,duration:200},close:{duration:100,hide:!0}}},_animationClose:function(){var e=this,t=e.wrapper.data(k);e.wrapper.hide(),t&&e.wrapper.css(t),e.options.anchor!=_&&e._hideDirClass(),e._closing=!1,e._trigger(d)},destroy:function(){var t,o=this,n=o.options,r=o.element.off(A);s.fn.destroy.call(o),n.toggleTarget&&e(n.toggleTarget).off(A),n.modal||(S.unbind(o.downEvent,o._mousedownProxy),o._toggleResize(!1)),i.destroy(o.element.children()),r.removeData(),n.appendTo[0]===document.body&&(t=r.parent(".k-animation-container"),t[0]?t.remove():r.remove())},open:function(t,o){var n,s,a=this,p={isFixed:!isNaN(parseInt(o,10)),x:t,y:o},d=a.element,c=a.options,f=e(c.anchor),u=d[0]&&d.hasClass("km-widget");if(!a.visible()){if(c.copyAnchorStyles&&(u&&"font-size"==D[0]&&D.shift(),d.css(i.getComputedStyles(f[0],D))),d.data("animating")||a._trigger(l))return;a._activated=!1,c.modal||(S.unbind(a.downEvent,a._mousedownProxy).bind(a.downEvent,a._mousedownProxy),a._toggleResize(!1),a._toggleResize(!0)),a.wrapper=s=i.wrap(d,c.autosize).css({overflow:v,display:"block",position:w}),r.mobileOS.android&&s.css(R,"translatez(0)"),s.css(y),e(c.appendTo)[0]==document.body&&s.css(g,"-10000px"),a.flipped=a._position(p),n=a._openAnimation(),c.anchor!=_&&a._showDirClass(n),d.data(b,n.effects).kendoStop(!0).kendoAnimate(n)}},_openAnimation:function(){var e=I(!0,{},this.options.animation.open);return e.effects=i.parseEffects(e.effects,this.flipped),e},_hideDirClass:function(){var t=e(this.options.anchor),o=((t.attr("class")||"").match(T)||["","down"])[1],n=C+"-"+o;t.removeClass(n).children(P).removeClass(x).removeClass(n),this.element.removeClass(C+"-"+i.directions[o].reverse)},_showDirClass:function(t){var o=t.effects.slideIn?t.effects.slideIn.direction:"down",n=C+"-"+o;e(this.options.anchor).addClass(n).children(P).addClass(x).addClass(n),this.element.addClass(C+"-"+i.directions[o].reverse)},position:function(){this.visible()&&(this.flipped=this._position())},toggle:function(){var e=this;e[e.visible()?p:l]()},visible:function(){return this.element.is(":"+z)},close:function(o){var n,s,r,a,l=this,d=l.options;if(l.visible()){if(n=l.wrapper[0]?l.wrapper:i.wrap(l.element).hide(),l._toggleResize(!1),l._closing||l._trigger(p))return l._toggleResize(!0),t;l.element.find(".k-popup").each(function(){var t=e(this),i=t.data("kendoPopup");i&&i.close(o)}),S.unbind(l.downEvent,l._mousedownProxy),o?s={hide:!0,effects:{}}:(s=I(!0,{},d.animation.close),r=l.element.data(b),a=s.effects,!a&&!i.size(a)&&r&&i.size(r)&&(s.effects=r,s.reverse=!0),l._closing=!0),l.element.kendoStop(!0),n.css({overflow:v}),l.element.kendoAnimate(s)}},_trigger:function(e){return this.trigger(e,{type:e})},_resize:function(e){var t=this;-1!==r.resize.indexOf(e.type)?(clearTimeout(t._resizeTimeout),t._resizeTimeout=setTimeout(function(){t._position(),t._resizeTimeout=null},50)):(!t._hovered||t._activated&&t.element.hasClass("k-list-container"))&&t.close()},_toggleResize:function(e){var t=e?"on":"off",o=r.resize;r.mobileOS.ios||r.mobileOS.android||(o+=" "+W),this._scrollableParents()[t](W,this._resizeProxy),H[t](o,this._resizeProxy)},_mousedown:function(t){var n=this,s=n.element[0],r=n.options,a=e(r.anchor)[0],l=r.toggleTarget,p=i.eventTarget(t),d=e(p).closest(".k-popup"),c=d.parent().parent(".km-shim").length;d=d[0],(c||!d||d===n.element[0])&&"popover"!==e(t.target).closest("a").data("rel")&&(o(s,p)||o(a,p)||l&&o(e(l)[0],p)||n.close())},_fit:function(e,t,o){var i=0;return e+t>o&&(i=o-(e+t)),0>e&&(i=-e),i},_flip:function(e,t,o,i,n,s,r){var a=0;return r=r||t,s!==n&&s!==f&&n!==f&&(e+r>i&&(a+=-(o+t)),0>e+a&&(a+=o+t)),a},_scrollableParents:function(){return e(this.options.anchor).parentsUntil("body").filter(function(e,t){return i.isScrollable(t)})},_position:function(t){var o,n,s,l,p,d,c,f,u,h,g,m,v,_=this,z=_.element,b=_.wrapper,x=_.options,C=e(x.viewport),T=C.offset(),P=e(x.anchor),E=x.origin.toLowerCase().split(" "),S=x.position.toLowerCase().split(" "),H=_.collisions,W=r.zoomLevel(),O=10002,R=!!(C[0]==window&&window.innerWidth&&1.02>=W),A=0,D=document.documentElement,L=R?window.innerWidth:C.width(),j=R?window.innerHeight:C.height();if(R&&D.scrollHeight-D.clientHeight>0&&(L-=i.support.scrollbar()),o=P.parents().filter(b.siblings()),o[0])if(s=Math.max(+o.css("zIndex"),0))O=s+10;else for(n=P.parentsUntil(o),l=n.length;l>A;A++)s=+e(n[A]).css("zIndex"),s&&s>O&&(O=s+10);return b.css("zIndex",O),b.css(t&&t.isFixed?{left:t.x,top:t.y}:_._align(E,S)),p=a(b,y,P[0]===b.offsetParent()[0]),d=a(b),c=P.offsetParent().parent(".k-animation-container,.k-popup,.k-group"),c.length&&(p=a(b,y,!0),d=a(b)),C[0]===window?(d.top-=window.pageYOffset||document.documentElement.scrollTop||0,d.left-=window.pageXOffset||document.documentElement.scrollLeft||0):(d.top-=T.top,d.left-=T.left),_.wrapper.data(k)||b.data(k,I({},p)),f=I({},d),u=I({},p),h=x.adjustSize,"fit"===H[0]&&(u.top+=_._fit(f.top,b.outerHeight()+h.height,j/W)),"fit"===H[1]&&(u.left+=_._fit(f.left,b.outerWidth()+h.width,L/W)),g=I({},u),m=z.outerHeight(),v=b.outerHeight(),!b.height()&&m&&(v+=m),"flip"===H[0]&&(u.top+=_._flip(f.top,m,P.outerHeight(),j/W,E[0],S[0],v)),"flip"===H[1]&&(u.left+=_._flip(f.left,z.outerWidth(),P.outerWidth(),L/W,E[1],S[1],b.outerWidth())),z.css(y,w),b.css(u),u.left!=g.left||u.top!=g.top},_align:function(t,o){var i,n=this,s=n.wrapper,r=e(n.options.anchor),l=t[0],p=t[1],d=o[0],c=o[1],u=a(r),g=e(n.options.appendTo),w=s.outerWidth(),v=s.outerHeight(),_=r.outerWidth(),k=r.outerHeight(),y=u.top,z=u.left,b=Math.round;return g[0]!=document.body&&(i=a(g),y-=i.top,z-=i.left),l===m&&(y+=k),l===f&&(y+=b(k/2)),d===m&&(y-=v),d===f&&(y-=b(v/2)),p===h&&(z+=_),p===f&&(z+=b(_/2)),c===h&&(z-=w),c===f&&(z-=b(w/2)),{top:y,left:z}}});n.plugin(L)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,o){(o||t)()});
//# sourceMappingURL=kendo.popup.min.js.map