/*
@license

dhtmlxGantt v.4.1.0 Stardard
This software is covered by GPL license. You also can obtain Commercial or Enterprise license to use it in non-GPL project - please contact sales@dhtmlx.com. Usage without proper license is prohibited.

(c) Dinamenta, UAB.
*/
gantt._tooltip={},gantt._tooltip_class="gantt_tooltip",gantt.config.tooltip_timeout=30,gantt.config.tooltip_offset_y=20,gantt.config.tooltip_offset_x=10,gantt._create_tooltip=function(){return this._tooltip_html||(this._tooltip_html=document.createElement("div"),this._tooltip_html.className=gantt._tooltip_class,this._waiAria.tooltipAttr(this._tooltip_html)),this._tooltip_html},gantt._is_cursor_under_tooltip=function(t,e){return t.x>=e.pos.x&&t.x<=e.pos.x+e.width?!0:t.y>=e.pos.y&&t.y<=e.pos.y+e.height?!0:!1;
},gantt._show_tooltip=function(t,e){if(!gantt.config.touch||gantt.config.touch_tooltip){var n=this._create_tooltip();n.innerHTML=t,gantt.$task_data.appendChild(n);var a=n.offsetWidth+20,i=n.offsetHeight+40,s=this.$task.offsetHeight,r=this.$task.offsetWidth,o=this.getScrollState();gantt._waiAria.tooltipVisibleAttr(n),e.y+=o.y;var l={x:e.x,y:e.y};e.x+=1*gantt.config.tooltip_offset_x||0,e.y+=1*gantt.config.tooltip_offset_y||0,e.y=Math.min(Math.max(o.y,e.y),o.y+s-i),e.x=Math.min(Math.max(o.x,e.x),o.x+r-a),
gantt._is_cursor_under_tooltip(l,{pos:e,width:a,height:i})&&(l.x+a>r+o.x&&(e.x=l.x-(a-20)-(1*gantt.config.tooltip_offset_x||0)),l.y+i>s+o.y&&(e.y=l.y-(i-40)-(1*gantt.config.tooltip_offset_y||0))),n.style.left=e.x+"px",n.style.top=e.y+"px"}},gantt._hide_tooltip=function(){this._tooltip_html&&this._waiAria.tooltipHiddenAttr(this._tooltip_html),this._tooltip_html&&this._tooltip_html.parentNode&&this._tooltip_html.parentNode.removeChild(this._tooltip_html),this._tooltip_id=0},gantt._is_tooltip=function(t){
var e=t.target||t.srcElement;return gantt._is_node_child(e,function(t){return t.className==this._tooltip_class})},gantt._is_task_line=function(t){var e=t.target||t.srcElement;return gantt._is_node_child(e,function(t){return t==this.$task_data})},gantt._is_node_child=function(t,e){for(var n=!1;t&&!n;)n=e.call(gantt,t),t=t.parentNode;return n},gantt._tooltip_pos=function(t){if(t.pageX||t.pageY)var e={x:t.pageX,y:t.pageY};var n=gantt.env.isIE?document.documentElement:document.body,e={x:t.clientX+n.scrollLeft-n.clientLeft,
y:t.clientY+n.scrollTop-n.clientTop},a=gantt._get_position(gantt.$task_data);return e.x=e.x-a.x,e.y=e.y-a.y,e},gantt.attachEvent("onMouseMove",function(t,e){if(this.config.tooltip_timeout){document.createEventObject&&!document.createEvent&&(e=document.createEventObject(e));var n=this.config.tooltip_timeout;this._tooltip_id&&!t&&(isNaN(this.config.tooltip_hide_timeout)||(n=this.config.tooltip_hide_timeout)),clearTimeout(gantt._tooltip_ev_timer),gantt._tooltip_ev_timer=setTimeout(function(){gantt._init_tooltip(t,e);
},n)}else gantt._init_tooltip(t,e)}),gantt._init_tooltip=function(t,e){if(!this._is_tooltip(e)&&(t!=this._tooltip_id||this._is_task_line(e))){if(!t)return this._hide_tooltip();this._tooltip_id=t;var n=this.getTask(t),a=this.templates.tooltip_text(n.start_date,n.end_date,n);return a?void this._show_tooltip(a,this._tooltip_pos(e)):void this._hide_tooltip()}},gantt.attachEvent("onMouseLeave",function(t){gantt._is_tooltip(t)||this._hide_tooltip()});
//# sourceMappingURL=../sources/ext/dhtmlxgantt_tooltip.js.map