jsgantt-improved
Advanced tools
Comparing version 2.6.4 to 2.6.5
@@ -91,5 +91,6 @@ "use strict"; | ||
// draw the current date line | ||
if (this.vTodayPx >= 0) | ||
if (this.vTodayPx >= 0) { | ||
this.sLine(this.vTodayPx, 0, this.vTodayPx, this.getChartTable().offsetHeight - 1, 'gCurDate'); | ||
} | ||
}; | ||
//# sourceMappingURL=draw_dependencies.js.map |
@@ -444,3 +444,3 @@ "use strict"; | ||
*/ | ||
this.drawCharBody = function (vTaskLeftPx, vTmpContentTabWrapper, gChartLbl, gListLbl, vMinDate, vSingleCell, vNumCols, vColWidth, vDateRow) { | ||
this.drawCharBody = function (vTaskLeftPx, vTmpContentTabWrapper, gChartLbl, gListLbl, vMinDate, vMaxDate, vSingleCell, vNumCols, vColWidth, vDateRow) { | ||
var vRightTable = document.createDocumentFragment(); | ||
@@ -506,3 +506,3 @@ var vTmpDiv = draw_utils_1.newNode(vRightTable, 'div', this.vDivId + 'gchartbody', 'gchartgrid gcontainercol'); | ||
if (!vSingleCell && !vComb) { | ||
this.drawColsChart(vNumCols, vTmpRow, taskCellWidth); | ||
this.drawColsChart(vNumCols, vTmpRow, taskCellWidth, vMinDate, vMaxDate); | ||
} | ||
@@ -535,3 +535,3 @@ } | ||
if (!vSingleCell && !vComb) { | ||
this.drawColsChart(vNumCols, vTmpRow, taskCellWidth); | ||
this.drawColsChart(vNumCols, vTmpRow, taskCellWidth, vMinDate, vMaxDate); | ||
} | ||
@@ -585,5 +585,4 @@ } | ||
// Background cells | ||
if (!vSingleCell && !vComb) { | ||
if (vTmpRow) | ||
this.drawColsChart(vNumCols, vTmpRow, taskCellWidth); | ||
if (!vSingleCell && !vComb && vTmpRow) { | ||
this.drawColsChart(vNumCols, vTmpRow, taskCellWidth, vMinDate, vMaxDate); | ||
} | ||
@@ -614,3 +613,5 @@ } | ||
var _a = this.createTaskInfo(this.vTaskList[i], this.vTooltipTemplate), component = _a.component, callback = _a.callback; | ||
vTmpDiv2.appendChild(component); | ||
var el = document.createElement('div'); | ||
el.appendChild(component); | ||
vTmpDiv2.setAttribute('data-tooltip', el.innerHTML); | ||
events_1.addTooltipListeners(this, this.vTaskList[i].getTaskDiv(), vTmpDiv2, callback); | ||
@@ -622,3 +623,5 @@ } | ||
var _b = this.createTaskInfo(this.vTaskList[i], this.vTooltipTemplate), component = _b.component, callback = _b.callback; | ||
vTmpDiv2.appendChild(component); | ||
var el = document.createElement('div'); | ||
el.appendChild(component); | ||
vTmpDiv2.setAttribute('data-tooltip', el.innerHTML); | ||
events_1.addTooltipListeners(this, this.vTaskList[i].getPlanTaskDiv(), vTmpDiv2, callback); | ||
@@ -640,9 +643,28 @@ } | ||
}; | ||
this.drawColsChart = function (vNumCols, vTmpRow, taskCellWidth) { | ||
var vCellFormat = ''; | ||
this.drawColsChart = function (vNumCols, vTmpRow, taskCellWidth, pStartDate, pEndDate) { | ||
if (pStartDate === void 0) { pStartDate = null; } | ||
if (pEndDate === void 0) { pEndDate = null; } | ||
var columnCurrentDay = null; | ||
// Find the Current day cell to put a different class | ||
if (this.vShowWeekends !== false && pStartDate && pEndDate && (this.vFormat == 'day' || this.vFormat == 'week')) { | ||
var curTaskStart = new Date(pStartDate.getTime()); | ||
var curTaskEnd = new Date(); | ||
var onePeriod = 3600000; | ||
if (this.vFormat == 'day') { | ||
onePeriod *= 24; | ||
} | ||
else if (this.vFormat == 'week') { | ||
onePeriod *= 24 * 7; | ||
} | ||
columnCurrentDay = Math.floor(general_utils_1.calculateCurrentDateOffset(curTaskStart, curTaskEnd) / onePeriod) - 1; | ||
} | ||
for (var j = 0; j < vNumCols - 1; j++) { | ||
if (this.vShowWeekends !== false && this.vFormat == 'day' && ((j % 7 == 4) || (j % 7 == 5))) | ||
var vCellFormat = 'gtaskcell gtaskcellcols'; | ||
if (this.vShowWeekends !== false && this.vFormat == 'day' && ((j % 7 == 4) || (j % 7 == 5))) { | ||
vCellFormat = 'gtaskcellwkend'; | ||
else | ||
vCellFormat = 'gtaskcell gtaskcellcols'; | ||
} | ||
//When is the column is the current day/week,give a different class | ||
else if ((this.vFormat == 'week' || this.vFormat == 'day') && j === columnCurrentDay) { | ||
vCellFormat = 'gtaskcellcurrent'; | ||
} | ||
draw_utils_1.newNode(vTmpRow, 'td', null, vCellFormat, '\u00A0\u00A0', taskCellWidth); | ||
@@ -709,3 +731,3 @@ } | ||
*/ | ||
var vRightTable = this.drawCharBody(vTaskLeftPx, vTmpContentTabWrapper, gChartLbl, gListLbl, vMinDate, vSingleCell, vNumCols, vColWidth, vDateRow).vRightTable; | ||
var vRightTable = this.drawCharBody(vTaskLeftPx, vTmpContentTabWrapper, gChartLbl, gListLbl, vMinDate, vMaxDate, vSingleCell, vNumCols, vColWidth, vDateRow).vRightTable; | ||
if (this.vDebug) { | ||
@@ -768,4 +790,5 @@ var ad = new Date(); | ||
} | ||
if (vMinDate.getTime() <= (new Date()).getTime() && vMaxDate.getTime() >= (new Date()).getTime()) | ||
if (vMinDate.getTime() <= (new Date()).getTime() && vMaxDate.getTime() >= (new Date()).getTime()) { | ||
this.vTodayPx = general_utils_1.getOffset(vMinDate, new Date(), vColWidth, this.vFormat, this.vShowWeekends); | ||
} | ||
else | ||
@@ -772,0 +795,0 @@ this.vTodayPx = -1; |
@@ -138,5 +138,5 @@ "use strict"; | ||
clearTimeout(pGanttChartObj.vTool.delayTimeout); | ||
var newHTML = pContents.innerHTML; | ||
var newHTML = pContents.getAttribute('data-tooltip'); | ||
if (pGanttChartObj.vTool.vToolCont.getAttribute("content") !== newHTML) { | ||
pGanttChartObj.vTool.vToolCont.innerHTML = pContents.innerHTML; | ||
pGanttChartObj.vTool.vToolCont.innerHTML = pContents.getAttribute('data-tooltip'); | ||
// as we are allowing arbitrary HTML we should remove any tag ids to prevent duplication | ||
@@ -143,0 +143,0 @@ general_utils_1.stripIds(pGanttChartObj.vTool.vToolCont); |
@@ -107,2 +107,7 @@ "use strict"; | ||
}; | ||
exports.calculateCurrentDateOffset = function (curTaskStart, curTaskEnd) { | ||
var tmpTaskStart = Date.UTC(curTaskStart.getFullYear(), curTaskStart.getMonth(), curTaskStart.getDate(), curTaskStart.getHours(), 0, 0); | ||
var tmpTaskEnd = Date.UTC(curTaskEnd.getFullYear(), curTaskEnd.getMonth(), curTaskEnd.getDate(), curTaskEnd.getHours(), 0, 0); | ||
return (tmpTaskEnd - tmpTaskStart); | ||
}; | ||
exports.getOffset = function (pStartDate, pEndDate, pColWidth, pFormat, pShowWeekends) { | ||
@@ -118,6 +123,5 @@ var DAY_CELL_MARGIN_WIDTH = 3; // Cell margin for 'day' format | ||
var vTaskRightPx = 0; | ||
var tmpTaskStart = Date.UTC(curTaskStart.getFullYear(), curTaskStart.getMonth(), curTaskStart.getDate(), curTaskStart.getHours(), 0, 0); | ||
var tmpTaskEnd = Date.UTC(curTaskEnd.getFullYear(), curTaskEnd.getMonth(), curTaskEnd.getDate(), curTaskEnd.getHours(), 0, 0); | ||
// Length of task in hours | ||
var oneHour = 3600000; | ||
var vTaskRight = (tmpTaskEnd - tmpTaskStart) / oneHour; // Length of task in hours | ||
var vTaskRight = exports.calculateCurrentDateOffset(curTaskStart, curTaskEnd) / oneHour; | ||
var vPosTmpDate; | ||
@@ -304,2 +308,6 @@ if (pFormat == 'day') { | ||
var vNewY = vMouseY; | ||
var screenX = screen.availWidth || window.innerWidth; | ||
var screenY = screen.availHeight || window.innerHeight; | ||
var vOldX = parseInt(pGanttChartObj.vTool.style.left); | ||
var vOldY = parseInt(pGanttChartObj.vTool.style.top); | ||
if (navigator.appName.toLowerCase() == 'microsoft internet explorer') { | ||
@@ -352,3 +360,4 @@ // the clientX and clientY properties include the left and top borders of the client area | ||
*/ | ||
if (pGanttChartObj.getUseMove()) { | ||
var outViewport = Math.abs(vOldX - vNewX) > screenX || Math.abs(vOldY - vNewY) > screenY; | ||
if (pGanttChartObj.getUseMove() && !outViewport) { | ||
clearInterval(pGanttChartObj.vTool.moveInterval); | ||
@@ -355,0 +364,0 @@ pGanttChartObj.vTool.moveInterval = setInterval(function () { exports.moveToolTip(vNewX, vNewY, pGanttChartObj.vTool, pTimer); }, pTimer); |
{ | ||
"name": "jsgantt-improved", | ||
"version": "2.6.4", | ||
"version": "2.6.5", | ||
"description": "jsgantt-improved", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4815550
113225