Skip to content

Commit

Permalink
[update] version 7.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKlimenkov committed Jun 30, 2021
1 parent a4f0c0b commit 98449bb
Show file tree
Hide file tree
Showing 16 changed files with 126 additions and 58 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# dhtmlxGantt #

[![dhtmlx.com](https://img.shields.io/badge/made%20by-DHTMLX-blue)](https://dhtmlx.com/)
[![npm: v.7.1.3](https://img.shields.io/badge/npm-v.7.1.3-blue.svg)](https://www.npmjs.com/package/dhtmlx-gantt)
[![npm: v.7.1.4](https://img.shields.io/badge/npm-v.7.1.4-blue.svg)](https://www.npmjs.com/package/dhtmlx-gantt)
[![License: GPL v2](https://img.shields.io/badge/license-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)

[Getting started](#getting-started) | [Features](#features) | [Follow us](#followus) | [License](#license) | [Useful links](#links)
Expand Down Expand Up @@ -128,7 +128,7 @@ Like our page on [Facebook](https://www.facebook.com/dhtmlx/) :thumbsup:
<a name="license"></a>
## License ##

dhtmlxGantt v.7.1.3 Standard
dhtmlxGantt v.7.1.4 Standard

This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gantt",
"version": "7.1.3",
"version": "7.1.4",
"homepage": "https://dhtmlx.com/docs/products/dhtmlxGantt/",
"description": "An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.",
"main": [
Expand Down
2 changes: 1 addition & 1 deletion codebase/dhtmlxgantt.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Type definitions for dhtmlxGantt 7.1.3
// Type definitions for dhtmlxGantt 7.1.4
// Project: https://dhtmlx.com/docs/products/dhtmlxGantt

type GanttCallback = (...args: any[]) => any;
Expand Down
6 changes: 3 additions & 3 deletions codebase/dhtmlxgantt.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion codebase/dhtmlxgantt.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion codebase/sources/dhtmlxgantt.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
@license
dhtmlxGantt v.7.1.3 Standard
dhtmlxGantt v.7.1.4 Standard
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
Expand Down
138 changes: 97 additions & 41 deletions codebase/sources/dhtmlxgantt.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
@license

dhtmlxGantt v.7.1.3 Standard
dhtmlxGantt v.7.1.4 Standard

This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.

Expand Down Expand Up @@ -13605,8 +13605,10 @@ module.exports = function (gantt) {
if (this.$root) {
if (this.config.rtl) {
this.$root.classList.add("gantt_rtl");
this.$root.firstChild.classList.add("gantt_rtl"); // GS-1499
} else {
this.$root.classList.remove("gantt_rtl");
this.$root.firstChild.classList.remove("gantt_rtl"); // GS-1499
}
}

Expand Down Expand Up @@ -14347,33 +14349,54 @@ module.exports = function (gantt) {
};
}

function updateParents(childId) {
gantt.batchUpdate(function () {
checkParent(childId);
});
}
function checkTaskType(id, changedTypes) {
var task = gantt.getTask(id);
var targetType = getTaskTypeToUpdate(task);

var delTaskParent;
if (targetType !== false && gantt.getTaskType(task) !== targetType) {
changedTypes.$needsUpdate = true;
changedTypes[task.id] = {
task: task,
type: targetType
};
}
}

function checkParent(id) {
setTaskType(id);
var parent = gantt.getParent(id);
function getUpdatedTypes(id, changedTypes) {
changedTypes = changedTypes || {};
checkTaskType(id, changedTypes);
gantt.eachParent(function (parent) {
checkTaskType(parent.id, changedTypes);
}, id);
return changedTypes;
}

if (parent != gantt.config.root_id) {
checkParent(parent);
function applyChanges(changedTypes) {
for (var i in changedTypes) {
if (changedTypes[i] && changedTypes[i].task) {
var task = changedTypes[i].task;
task.type = changedTypes[i].type;
gantt.updateTask(task.id);
}
}
}

function setTaskType(id) {
id = id.id || id;
var task = gantt.getTask(id);
var targetType = getTaskTypeToUpdate(task);
function updateParentTypes(startId) {
if (gantt.getState().group_mode) {
return;
}

if (targetType !== false) {
updateTaskType(task, targetType);
var changedTypes = getUpdatedTypes(startId);

if (changedTypes.$needsUpdate) {
gantt.batchUpdate(function () {
applyChanges(changedTypes);
});
}
}

var delTaskParent;

function updateTaskType(task, targetType) {
if (!gantt.getState().group_mode) {
task.type = targetType;
Expand All @@ -14400,6 +14423,11 @@ module.exports = function (gantt) {
var isParsingDone = true;
gantt.attachEvent("onParse", callIfEnabled(function () {
isParsingDone = false;

if (gantt.getState().group_mode) {
return;
}

gantt.batchUpdate(function () {
gantt.eachTask(function (task) {
var targetType = getTaskTypeToUpdate(task);
Expand All @@ -14413,18 +14441,18 @@ module.exports = function (gantt) {
}));
gantt.attachEvent("onAfterTaskAdd", callIfEnabled(function (id) {
if (isParsingDone) {
updateParents(id);
updateParentTypes(id);
}
}));
gantt.attachEvent("onAfterTaskUpdate", callIfEnabled(function (id) {
if (isParsingDone) {
updateParents(id);
updateParentTypes(id);
}
}));

function updateAfterRemoveChild(id) {
if (id != gantt.config.root_id && gantt.isTaskExists(id)) {
updateParents(id);
updateParentTypes(id);
}
}

Expand All @@ -14442,7 +14470,7 @@ module.exports = function (gantt) {
}));
gantt.attachEvent("onRowDragEnd", callIfEnabled(function (id, target) {
updateAfterRemoveChild(originalRowDndParent);
updateParents(id);
updateParentTypes(id);
}));
var originalMoveTaskParent;
gantt.attachEvent("onBeforeTaskMove", callIfEnabled(function (sid, parent, tindex) {
Expand All @@ -14456,7 +14484,7 @@ module.exports = function (gantt) {
}

updateAfterRemoveChild(originalMoveTaskParent);
updateParents(id);
updateParentTypes(id);
}));
};

Expand Down Expand Up @@ -16542,18 +16570,34 @@ function create(gantt) {

return nextItem;
},
editNextRow: function nextRow() {
var row = this.getNextCell(1);
editNextRow: function nextRow(skipReadonly) {
var id = this.getState().id;
if (!gantt.isTaskExists(id)) return;
var next = null;

if (skipReadonly) {
next = this.moveRow(1);
} else {
next = gantt.getNext(id);
}

if (row) {
this.startEdit(row, this._columnName);
if (gantt.isTaskExists(next)) {
this.startEdit(next, this._columnName);
}
},
editPrevRow: function prevRow() {
var row = this.getNextCell(-1);
editPrevRow: function prevRow(skipReadonly) {
var id = this.getState().id;
if (!gantt.isTaskExists(id)) return;
var prev = null;

if (row) {
this.startEdit(row, this._columnName);
if (skipReadonly) {
prev = this.moveRow(-1);
} else {
prev = gantt.getPrev(id);
}

if (gantt.isTaskExists(prev)) {
this.startEdit(prev, this._columnName);
}
},
destructor: function destructor() {
Expand Down Expand Up @@ -26180,7 +26224,7 @@ function generateRenderResourceHistogram(gantt) {

var capacityElement = renderHistogramLine(capacityMatrix, timeline, maxCapacity, viewport);

if (capacityElement) {
if (capacityElement && sizes) {
capacityElement.setAttribute("data-resource-id", resource.id);
capacityElement.setAttribute(timeline.$config.item_attribute, resource.id);
capacityElement.style.position = "absolute";
Expand Down Expand Up @@ -29680,8 +29724,8 @@ function createTaskDND(timeline, gantt) {
this._finalize_mouse_up(drag.id, config, drag, e);
};

if (finalizingBulkMove && moveCount > 25) {
// 25 - arbitrary threshold for bulk dnd at which we start doing complete repaint to refresh
if (finalizingBulkMove && moveCount > 10) {
// 10 - arbitrary threshold for bulk dnd at which we start doing complete repaint to refresh
gantt.batchUpdate(function () {
doFinalize.call(this);
}.bind(this));
Expand Down Expand Up @@ -35281,6 +35325,8 @@ var SelectedRegion = /** @class */ (function () {
}
this._viewPort.callEvent("onBeforeDragEnd", [this._startPoint, endPoint]);
this.setEnd(endPoint);
// GS-1422. The endDate can be null if we drag the mouse outside the Gantt container
this._endDate = this._endDate || gantt.getState().max_date;
if (this._startDate.valueOf() > this._endDate.valueOf()) {
_a = [this._endDate, this._startDate], this._startDate = _a[0], this._endDate = _a[1];
}
Expand Down Expand Up @@ -37211,8 +37257,15 @@ module.exports = function (gantt) {

if (pos.top < scroll.y || pos.top + height > scroll.y + viewHeight) {
gantt.scrollTo(null, pos.top - height * 5);
} else if (gantt.config.scroll_on_click && gantt.config.show_chart && (pos.left < scroll.x || pos.left > scroll.x + viewWidth)) {
gantt.scrollTo(pos.left - gantt.config.task_scroll_offset);
} else if (gantt.config.scroll_on_click && gantt.config.show_chart) {
// horizontal scroll activated
if (pos.left > scroll.x + viewWidth) {
// scroll forward to the start of the task
gantt.scrollTo(pos.left - gantt.config.task_scroll_offset);
} else if (pos.left + pos.width < scroll.x) {
// scroll back to the end of the task
gantt.scrollTo(pos.left + pos.width - gantt.config.task_scroll_offset);
}
}
}

Expand Down Expand Up @@ -37938,10 +37991,13 @@ function default_1(gantt) {
return gantt.templates.task_time(start, end, ev);
};
gantt.templates.quick_info_class = function (start, end, task) { return ""; };
gantt.attachEvent("onTaskClick", function (id) {
setTimeout(function () {
gantt.ext.quickInfo.show(id);
}, 0);
gantt.attachEvent("onTaskClick", function (id, e) {
// GS-1460 Don't show Quick Info when clicking on the "+" button
if (!gantt.utils.dom.closest(e.target, ".gantt_add")) {
setTimeout(function () {
gantt.ext.quickInfo.show(id);
}, 0);
}
return true;
});
var events = ["onViewChange", "onLightbox", "onBeforeTaskDelete", "onBeforeDrag"];
Expand Down Expand Up @@ -39476,7 +39532,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi

function DHXGantt() {
this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
this.version = "7.1.3";
this.version = "7.1.4";
this.license = "gpl";
this.templates = {};
this.ext = {};
Expand Down
2 changes: 1 addition & 1 deletion codebase/sources/skins/dhtmlxgantt_broadway.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
@license
dhtmlxGantt v.7.1.3 Standard
dhtmlxGantt v.7.1.4 Standard
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
Expand Down
2 changes: 1 addition & 1 deletion codebase/sources/skins/dhtmlxgantt_contrast_black.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
@license
dhtmlxGantt v.7.1.3 Standard
dhtmlxGantt v.7.1.4 Standard
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
Expand Down
2 changes: 1 addition & 1 deletion codebase/sources/skins/dhtmlxgantt_contrast_white.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
@license
dhtmlxGantt v.7.1.3 Standard
dhtmlxGantt v.7.1.4 Standard
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
Expand Down
2 changes: 1 addition & 1 deletion codebase/sources/skins/dhtmlxgantt_material.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
@license
dhtmlxGantt v.7.1.3 Standard
dhtmlxGantt v.7.1.4 Standard
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
Expand Down
2 changes: 1 addition & 1 deletion codebase/sources/skins/dhtmlxgantt_meadow.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
@license
dhtmlxGantt v.7.1.3 Standard
dhtmlxGantt v.7.1.4 Standard
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
Expand Down
2 changes: 1 addition & 1 deletion codebase/sources/skins/dhtmlxgantt_skyblue.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
@license
dhtmlxGantt v.7.1.3 Standard
dhtmlxGantt v.7.1.4 Standard
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
Expand Down
2 changes: 1 addition & 1 deletion codebase/sources/skins/dhtmlxgantt_terrace.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
@license
dhtmlxGantt v.7.1.3 Standard
dhtmlxGantt v.7.1.4 Standard
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dhtmlx-gantt",
"version": "7.1.3",
"version": "7.1.4",
"description": "An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.",
"main": "codebase/dhtmlxgantt.js",
"types": "codebase/dhtmlxgantt.d.ts",
Expand Down
12 changes: 12 additions & 0 deletions whatsnew.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
### 7.1.4

Fix the incorrect work of unsetWorkTime that caused affected dates to have incorrect work hours
Fix the script error thrown in the Resource histogram after scrolling the histogram when resource_render_empty_cell is set to false and smart_rendering is enabled
Fix the incorrect work of the editNextRow and editPrevRow methods of the Inline Editors module
Fix the incorrect work of the Quick Info popup that caused the popup to be displayed after clicking on the "add" button in the grid
Fix the incorrect work of the ASAP constraints that caused tasks not to be moved to the earliest date of the project
Fix the incorrect work of Inline Editors that prevented constraints from being edited via the inline editor
Fix the incorrect behavior of the "scroll into view" logic of Keyboard Navigation which called an unnecessary scroll when selected task bars are visible
Fix the script error thrown when the mouse is moved outside the container when the click_drag extension is enabled
Performance improvements for the auto_types configuration option of Gantt

### 7.1.3

Fix the script error thrown on gantt.moveTask call when some tasks are hidden via the onBeforeTaskDisplay event
Expand Down

0 comments on commit 98449bb

Please sign in to comment.