Skip to content

Commit 4ec78bd

Browse files
authored
Merge pull request #332 from joules457/hotfix/issue-331
Hotfix/issue 331
2 parents 9cc17e6 + 8b89991 commit 4ec78bd

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/draw.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -691,18 +691,14 @@ export const GanttChart = function (pDiv, pFormat) {
691691
if (this.vTaskList[i].getTaskDiv() && vTmpDiv) {
692692
const vTmpDiv2 = newNode(vTmpDiv, 'div', this.vDivId + 'tt' + vID, null, null, null, null, 'none');
693693
const { component, callback } = this.createTaskInfo(this.vTaskList[i], this.vTooltipTemplate);
694-
const el = document.createElement('div');
695-
el.appendChild(component);
696-
vTmpDiv2.setAttribute('data-tooltip', el.innerHTML)
694+
vTmpDiv2.appendChild(component);
697695
addTooltipListeners(this, this.vTaskList[i].getTaskDiv(), vTmpDiv2, callback);
698696
}
699697
// Add Plan Task Info div for tooltip
700698
if (this.vTaskList[i].getPlanTaskDiv() && vTmpDiv) {
701699
const vTmpDiv2 = newNode(vTmpDiv, 'div', this.vDivId + 'tt' + vID, null, null, null, null, 'none');
702700
const { component, callback } = this.createTaskInfo(this.vTaskList[i], this.vTooltipTemplate);
703-
const el = document.createElement('div');
704-
el.appendChild(component);
705-
vTmpDiv2.setAttribute('data-tooltip', el.innerHTML)
701+
vTmpDiv2.appendChild(component);
706702
addTooltipListeners(this, this.vTaskList[i].getPlanTaskDiv(), vTmpDiv2, callback);
707703
}
708704
}

src/events.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ export const showToolTip = function (pGanttChartObj, e, pContents, pWidth, pTime
143143
}
144144
clearTimeout(pGanttChartObj.vTool.delayTimeout);
145145

146-
const newHTML = pContents.getAttribute('data-tooltip');
146+
const newHTML = pContents.innerHTML;
147147

148148
if (pGanttChartObj.vTool.vToolCont.getAttribute("content") !== newHTML) {
149-
pGanttChartObj.vTool.vToolCont.innerHTML = pContents.getAttribute('data-tooltip');
149+
pGanttChartObj.vTool.vToolCont.innerHTML = pContents.innerHTML;
150150
// as we are allowing arbitrary HTML we should remove any tag ids to prevent duplication
151151
stripIds(pGanttChartObj.vTool.vToolCont);
152152
pGanttChartObj.vTool.vToolCont.setAttribute("content", newHTML);

0 commit comments

Comments
 (0)