/* This software is allowed to use under GPL or you need to obtain Commercial or Enterprise License to use it in non-GPL project. Please contact sales@dhtmlx.com for details */ gantt.config.quickinfo_buttons = ["icon_delete","icon_edit"]; gantt.config.quick_info_detached = true; gantt.attachEvent("onTaskClick", function(id){ gantt.showQuickInfo(id); return true; }); (function(){ var events = ["onEmptyClick", "onViewChange", "onLightbox", "onBeforeTaskDelete", "onBeforeDrag"]; var hiding_function = function(){ gantt._hideQuickInfo(); return true; }; for (var i=0; i" + "
" + "" + "
"; //buttons html += "
"; var buttons = gantt.config.quickinfo_buttons; for (var i = 0; i < buttons.length; i++) html += "
"+gantt.locale.labels[buttons[i]]+"
"; html += "
"; qi.innerHTML = html; dhtmlxEvent(qi, "click", function(ev){ ev = ev || event; gantt._qi_button_click(ev.target || ev.srcElement); }); if (gantt.config.quick_info_detached) dhtmlxEvent(gantt.$task_data, "scroll", function(){ gantt.hideQuickInfo(); }); } return this._quick_info_box; }; gantt._qi_button_click = function(node){ var box = gantt._quick_info_box; if (!node || node == box) return; var mask = node.className; if (mask.indexOf("_icon")!=-1){ var id = gantt._quick_info_box_id; gantt.$click.buttons[mask.split(" ")[1].replace("icon_","")](id); } else gantt._qi_button_click(node.parentNode); }; gantt._get_event_counter_part = function(id){ var domEv = gantt.getTaskNode(id); var left = 0; var top = 0; var node = domEv; while (node && node.className != "gantt_task"){ left += node.offsetLeft; top += node.offsetTop; node = node.offsetParent; } var scroll = this.getScrollState(); if(node){ var dx = (left + domEv.offsetWidth/2) - scroll.x > (gantt._x/2) ? 1 : 0; var dy = (top + domEv.offsetHeight/2) - scroll.y > (gantt._y/2) ? 1 : 0; return { left:left, top:top, dx:dx, dy:dy, width:domEv.offsetWidth, height:domEv.offsetHeight }; } return 0; }; gantt._fill_quick_data = function(id){ var ev = gantt.getTask(id); var qi = gantt._quick_info_box; gantt._quick_info_box_id = id; //title content var titleContent = qi.firstChild.firstChild; titleContent.innerHTML = gantt.templates.quick_info_title(ev.start_date, ev.end_date, ev); var titleDate = titleContent.nextSibling; titleDate.innerHTML = gantt.templates.quick_info_date(ev.start_date, ev.end_date, ev); //main content var main = qi.firstChild.nextSibling; main.innerHTML = gantt.templates.quick_info_content(ev.start_date, ev.end_date, ev); };