/* * Kendo UI Beta v2013.2.716 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Beta license terms available at * http://www.kendoui.com/purchase/license-agreement/kendo-ui-beta.aspx */ ("function"==typeof define&&define.amd?define:function(t,o){return o()})(["./kendo.core.min","./kendo.popup.min"],function(){!function(t){function o(t){for(;t.length;)e(t),t=t.parent()}function e(t){var o=t.data(r.ns+"title");o&&(t.attr("title",o),t.removeData(r.ns+"title"))}function n(t){var o=t.attr("title");o&&(t.data(r.ns+"title",o),t.attr("title",""))}function i(t){for(;t.length&&!t.is("body");)n(t),t=t.parent()}var r=window.kendo,s=r.ui.Widget,a=r.ui.Popup,c=t.isFunction,l=t.isPlainObject,p=t.extend,u=t.proxy,f=t(document),d=r.isLocalUrl,h="_tt_active",m="aria-describedby",g="show",v="hide",w="error",k="contentLoad",_="requestStart",y="k-content-frame",b='',H=r.template(""),T=".kendoTooltip",C={bottom:{origin:"bottom center",position:"top center"},top:{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"},center:{position:"center center",origin:"center center"}},D={top:"bottom",bottom:"top",left:"right",right:"left",center:"center"},x={bottom:"n",top:"s",left:"e",right:"w",center:"n"},O={horizontal:{offset:"top",size:"outerHeight"},vertical:{offset:"left",size:"outerWidth"}},j=function(t){return t.target.data(r.ns+"title")},A=s.extend({init:function(t,o){var e,n=this;s.fn.init.call(n,t,o),e=n.options.position.match(/left|right/)?"horizontal":"vertical",n.dimensions=O[e],n._documentKeyDownHandler=u(n._documentKeyDown,n),n.element.on(n.options.showOn+T,n.options.filter,u(n._showOn,n)).on("mouseenter"+T,n.options.filter,u(n._mouseenter,n)),this.options.autoHide&&n.element.on("mouseleave"+T,n.options.filter,u(n._mouseleave,n))},options:{name:"Tooltip",filter:"",content:j,showAfter:100,callout:!0,position:"bottom",showOn:"mouseenter",autoHide:!0,animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:40,hide:!0}}},events:[g,v,k,w,_],_mouseenter:function(o){i(t(o.currentTarget))},_showOn:function(o){var e=this;e.options.showOn&&e.options.showOn.match(/click|focus/)?e._show(t(o.currentTarget)):(clearTimeout(e.timeout),e.timeout=setTimeout(function(){e._show(t(o.currentTarget))},e.options.showAfter))},_appendContent:function(t){var o,e=this,n=e.options.content,i=e.content,s=e.options.iframe;l(n)&&n.url?("iframe"in e.options||(s=!d(n.url)),e.trigger(_,{options:n,target:t}),s?(i.hide(),o=i.find("."+y)[0],o?o.src=n.url||o.src:i.html(H({content:n})),i.find("."+y).off("load"+T).on("load"+T,function(){e.trigger(k),i.show()})):(i.empty(),r.ui.progress(i,!0),e._ajaxRequest(n))):n&&c(n)?(n=n({target:t}),e.content.html(n||"")):e.content.html(n)},_ajaxRequest:function(t){var o=this;jQuery.ajax(p({type:"GET",dataType:"html",cache:!1,error:function(t,e){r.ui.progress(o.content,!1),o.trigger(w,{status:e,xhr:t})},success:u(function(t){r.ui.progress(o.content,!1),o.content.html(t),o.trigger(k)},o)},t))},_documentKeyDown:function(t){t.keyCode===r.keys.ESC&&this.hide()},refresh:function(){var t=this,o=t.popup;o&&o.options.anchor&&t._appendContent(o.options.anchor)},hide:function(){this.popup&&this.popup.close()},show:function(t){i(t),this._show(t)},_show:function(t){var e=this,n=e.target();e.popup||e._initPopup(),n&&n[0]!=t[0]&&(e.popup.close(),e.popup.element.kendoStop(!0,!0)),n&&n[0]==t[0]||(e._appendContent(t),e.popup.options.anchor=t),e.popup.one("deactivate",function(){o(t),t.removeAttr(m),this.element.removeAttr("id").attr("aria-hidden",!0),f.off("keydown"+T,e._documentKeyDownHandler)}),e.popup.open()},_initPopup:function(){var o=this,e=o.options,n=t(r.template(b)({callout:e.callout&&"center"!==e.position,dir:x[e.position],autoHide:e.autoHide}));o.popup=new a(n,p({activate:function(){var t=this.options.anchor,n=t[0].id||o.element[0].id;n&&(t.attr(m,n+h),this.element.attr("id",n+h)),e.callout&&o._positionCallout(),this.element.removeAttr("aria-hidden"),f.on("keydown"+T,o._documentKeyDownHandler),o.trigger(g)},close:function(){o.trigger(v)},copyAnchorStyles:!1,animation:e.animation},C[e.position])),n.css({width:e.width,height:e.height}),o.content=n.find(".k-tooltip-content"),o.arrow=n.find(".k-callout"),e.autoHide?n.on("mouseleave"+T,u(o._mouseleave,o)):n.on("click"+T,".k-tooltip-button",u(o._closeButtonClick,o))},_closeButtonClick:function(t){t.preventDefault(),this.hide()},_mouseleave:function(e){if(this.popup){var n=t(e.currentTarget),i=n.offset(),r=e.pageX,s=e.pageY;if(i.right=i.left+n.outerWidth(),i.bottom=i.top+n.outerHeight(),r>i.left&&ri.top&&s