/* * Kendo UI Web v2013.1.319 (http://kendoui.com) * Copyright 2013 Telerik AD. All rights reserved. * * Kendo UI Web commercial licenses may be obtained at * https://www.kendoui.com/purchase/license-agreement/kendo-ui-web-commercial.aspx * If you do not own a commercial license, this file shall be governed by the * GNU General Public License (GPL) version 3. * For GPL requirements, please review: http://www.gnu.org/copyleft/gpl.html */ ("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;)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",w="hide",v="error",k="contentLoad",_="requestStart",y="k-content-frame",b='
',T=r.template(""),H=".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:"height"},vertical:{offset:"left",size:"width"}},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+H,n.options.filter,u(n._showOn,n)).on("mouseenter"+H,n.options.filter,u(n._mouseenter,n)),this.options.autoHide&&n.element.on("mouseleave"+H,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,w,k,v,_],_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(T({content:n})),i.find("."+y).off("load"+H).on("load"+H,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(v,{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()},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"+H,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"+H,o._documentKeyDownHandler),o.trigger(g)},close:function(){o.trigger(w)},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"+H,u(o._mouseleave,o)):n.on("click"+H,".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&&i.right>r&&s>i.top&&i.bottom>s)return;this.popup.close()}else o(t(e.currentTarget));clearTimeout(this.timeout)},_positionCallout:function(){var o=this,e=o.options.position,n=o.dimensions,i=n.offset,r=o.popup,s=r.options.anchor,a=t(s).offset(),c=parseInt(o.arrow.css("borderWidth"),10),l=t(r.element).offset(),p=x[r.flipped?D[e]:e],u=a[i]-l[i]+t(s)[n.size]()/2-c;o.arrow.removeClass("k-callout-n k-callout-s k-callout-w k-callout-e").addClass("k-callout-"+p).css(i,u)},target:function(){return this.popup?this.popup.options.anchor:null},destroy:function(){var t=this.popup;t&&(t.element.off(H),t.destroy()),this.element.off(H),f.off("keydown"+H,this._documentKeyDownHandler),s.fn.destroy.call(this)}});r.ui.plugin(A)})(window.kendo.jQuery)});