11/*
22@license
33
4- dhtmlxGantt v.7.1.3 Standard
4+ dhtmlxGantt v.7.1.4 Standard
55
66This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77
@@ -13605,8 +13605,10 @@ module.exports = function (gantt) {
1360513605 if (this.$root) {
1360613606 if (this.config.rtl) {
1360713607 this.$root.classList.add("gantt_rtl");
13608+ this.$root.firstChild.classList.add("gantt_rtl"); // GS-1499
1360813609 } else {
1360913610 this.$root.classList.remove("gantt_rtl");
13611+ this.$root.firstChild.classList.remove("gantt_rtl"); // GS-1499
1361013612 }
1361113613 }
1361213614
@@ -14347,33 +14349,54 @@ module.exports = function (gantt) {
1434714349 };
1434814350 }
1434914351
14350- function updateParents(childId) {
14351- gantt.batchUpdate(function () {
14352- checkParent(childId);
14353- });
14354- }
14352+ function checkTaskType(id, changedTypes) {
14353+ var task = gantt.getTask(id);
14354+ var targetType = getTaskTypeToUpdate(task);
1435514355
14356- var delTaskParent;
14356+ if (targetType !== false && gantt.getTaskType(task) !== targetType) {
14357+ changedTypes.$needsUpdate = true;
14358+ changedTypes[task.id] = {
14359+ task: task,
14360+ type: targetType
14361+ };
14362+ }
14363+ }
1435714364
14358- function checkParent(id) {
14359- setTaskType(id);
14360- var parent = gantt.getParent(id);
14365+ function getUpdatedTypes(id, changedTypes) {
14366+ changedTypes = changedTypes || {};
14367+ checkTaskType(id, changedTypes);
14368+ gantt.eachParent(function (parent) {
14369+ checkTaskType(parent.id, changedTypes);
14370+ }, id);
14371+ return changedTypes;
14372+ }
1436114373
14362- if (parent != gantt.config.root_id) {
14363- checkParent(parent);
14374+ function applyChanges(changedTypes) {
14375+ for (var i in changedTypes) {
14376+ if (changedTypes[i] && changedTypes[i].task) {
14377+ var task = changedTypes[i].task;
14378+ task.type = changedTypes[i].type;
14379+ gantt.updateTask(task.id);
14380+ }
1436414381 }
1436514382 }
1436614383
14367- function setTaskType(id ) {
14368- id = id.id || id;
14369- var task = gantt.getTask(id) ;
14370- var targetType = getTaskTypeToUpdate(task);
14384+ function updateParentTypes(startId ) {
14385+ if (gantt.getState().group_mode) {
14386+ return ;
14387+ }
1437114388
14372- if (targetType !== false) {
14373- updateTaskType(task, targetType);
14389+ var changedTypes = getUpdatedTypes(startId);
14390+
14391+ if (changedTypes.$needsUpdate) {
14392+ gantt.batchUpdate(function () {
14393+ applyChanges(changedTypes);
14394+ });
1437414395 }
1437514396 }
1437614397
14398+ var delTaskParent;
14399+
1437714400 function updateTaskType(task, targetType) {
1437814401 if (!gantt.getState().group_mode) {
1437914402 task.type = targetType;
@@ -14400,6 +14423,11 @@ module.exports = function (gantt) {
1440014423 var isParsingDone = true;
1440114424 gantt.attachEvent("onParse", callIfEnabled(function () {
1440214425 isParsingDone = false;
14426+
14427+ if (gantt.getState().group_mode) {
14428+ return;
14429+ }
14430+
1440314431 gantt.batchUpdate(function () {
1440414432 gantt.eachTask(function (task) {
1440514433 var targetType = getTaskTypeToUpdate(task);
@@ -14413,18 +14441,18 @@ module.exports = function (gantt) {
1441314441 }));
1441414442 gantt.attachEvent("onAfterTaskAdd", callIfEnabled(function (id) {
1441514443 if (isParsingDone) {
14416- updateParents (id);
14444+ updateParentTypes (id);
1441714445 }
1441814446 }));
1441914447 gantt.attachEvent("onAfterTaskUpdate", callIfEnabled(function (id) {
1442014448 if (isParsingDone) {
14421- updateParents (id);
14449+ updateParentTypes (id);
1442214450 }
1442314451 }));
1442414452
1442514453 function updateAfterRemoveChild(id) {
1442614454 if (id != gantt.config.root_id && gantt.isTaskExists(id)) {
14427- updateParents (id);
14455+ updateParentTypes (id);
1442814456 }
1442914457 }
1443014458
@@ -14442,7 +14470,7 @@ module.exports = function (gantt) {
1444214470 }));
1444314471 gantt.attachEvent("onRowDragEnd", callIfEnabled(function (id, target) {
1444414472 updateAfterRemoveChild(originalRowDndParent);
14445- updateParents (id);
14473+ updateParentTypes (id);
1444614474 }));
1444714475 var originalMoveTaskParent;
1444814476 gantt.attachEvent("onBeforeTaskMove", callIfEnabled(function (sid, parent, tindex) {
@@ -14456,7 +14484,7 @@ module.exports = function (gantt) {
1445614484 }
1445714485
1445814486 updateAfterRemoveChild(originalMoveTaskParent);
14459- updateParents (id);
14487+ updateParentTypes (id);
1446014488 }));
1446114489};
1446214490
@@ -16542,18 +16570,34 @@ function create(gantt) {
1654216570
1654316571 return nextItem;
1654416572 },
16545- editNextRow: function nextRow() {
16546- var row = this.getNextCell(1);
16573+ editNextRow: function nextRow(skipReadonly) {
16574+ var id = this.getState().id;
16575+ if (!gantt.isTaskExists(id)) return;
16576+ var next = null;
16577+
16578+ if (skipReadonly) {
16579+ next = this.moveRow(1);
16580+ } else {
16581+ next = gantt.getNext(id);
16582+ }
1654716583
16548- if (row ) {
16549- this.startEdit(row , this._columnName);
16584+ if (gantt.isTaskExists(next) ) {
16585+ this.startEdit(next , this._columnName);
1655016586 }
1655116587 },
16552- editPrevRow: function prevRow() {
16553- var row = this.getNextCell(-1);
16588+ editPrevRow: function prevRow(skipReadonly) {
16589+ var id = this.getState().id;
16590+ if (!gantt.isTaskExists(id)) return;
16591+ var prev = null;
1655416592
16555- if (row) {
16556- this.startEdit(row, this._columnName);
16593+ if (skipReadonly) {
16594+ prev = this.moveRow(-1);
16595+ } else {
16596+ prev = gantt.getPrev(id);
16597+ }
16598+
16599+ if (gantt.isTaskExists(prev)) {
16600+ this.startEdit(prev, this._columnName);
1655716601 }
1655816602 },
1655916603 destructor: function destructor() {
@@ -26180,7 +26224,7 @@ function generateRenderResourceHistogram(gantt) {
2618026224
2618126225 var capacityElement = renderHistogramLine(capacityMatrix, timeline, maxCapacity, viewport);
2618226226
26183- if (capacityElement) {
26227+ if (capacityElement && sizes ) {
2618426228 capacityElement.setAttribute("data-resource-id", resource.id);
2618526229 capacityElement.setAttribute(timeline.$config.item_attribute, resource.id);
2618626230 capacityElement.style.position = "absolute";
@@ -29680,8 +29724,8 @@ function createTaskDND(timeline, gantt) {
2968029724 this._finalize_mouse_up(drag.id, config, drag, e);
2968129725 };
2968229726
29683- if (finalizingBulkMove && moveCount > 25 ) {
29684- // 25 - arbitrary threshold for bulk dnd at which we start doing complete repaint to refresh
29727+ if (finalizingBulkMove && moveCount > 10 ) {
29728+ // 10 - arbitrary threshold for bulk dnd at which we start doing complete repaint to refresh
2968529729 gantt.batchUpdate(function () {
2968629730 doFinalize.call(this);
2968729731 }.bind(this));
@@ -35281,6 +35325,8 @@ var SelectedRegion = /** @class */ (function () {
3528135325 }
3528235326 this._viewPort.callEvent("onBeforeDragEnd", [this._startPoint, endPoint]);
3528335327 this.setEnd(endPoint);
35328+ // GS-1422. The endDate can be null if we drag the mouse outside the Gantt container
35329+ this._endDate = this._endDate || gantt.getState().max_date;
3528435330 if (this._startDate.valueOf() > this._endDate.valueOf()) {
3528535331 _a = [this._endDate, this._startDate], this._startDate = _a[0], this._endDate = _a[1];
3528635332 }
@@ -37211,8 +37257,15 @@ module.exports = function (gantt) {
3721137257
3721237258 if (pos.top < scroll.y || pos.top + height > scroll.y + viewHeight) {
3721337259 gantt.scrollTo(null, pos.top - height * 5);
37214- } else if (gantt.config.scroll_on_click && gantt.config.show_chart && (pos.left < scroll.x || pos.left > scroll.x + viewWidth)) {
37215- gantt.scrollTo(pos.left - gantt.config.task_scroll_offset);
37260+ } else if (gantt.config.scroll_on_click && gantt.config.show_chart) {
37261+ // horizontal scroll activated
37262+ if (pos.left > scroll.x + viewWidth) {
37263+ // scroll forward to the start of the task
37264+ gantt.scrollTo(pos.left - gantt.config.task_scroll_offset);
37265+ } else if (pos.left + pos.width < scroll.x) {
37266+ // scroll back to the end of the task
37267+ gantt.scrollTo(pos.left + pos.width - gantt.config.task_scroll_offset);
37268+ }
3721637269 }
3721737270 }
3721837271
@@ -37938,10 +37991,13 @@ function default_1(gantt) {
3793837991 return gantt.templates.task_time(start, end, ev);
3793937992 };
3794037993 gantt.templates.quick_info_class = function (start, end, task) { return ""; };
37941- gantt.attachEvent("onTaskClick", function (id) {
37942- setTimeout(function () {
37943- gantt.ext.quickInfo.show(id);
37944- }, 0);
37994+ gantt.attachEvent("onTaskClick", function (id, e) {
37995+ // GS-1460 Don't show Quick Info when clicking on the "+" button
37996+ if (!gantt.utils.dom.closest(e.target, ".gantt_add")) {
37997+ setTimeout(function () {
37998+ gantt.ext.quickInfo.show(id);
37999+ }, 0);
38000+ }
3794538001 return true;
3794638002 });
3794738003 var events = ["onViewChange", "onLightbox", "onBeforeTaskDelete", "onBeforeDrag"];
@@ -39476,7 +39532,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3947639532
3947739533function DHXGantt() {
3947839534 this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
39479- this.version = "7.1.3 ";
39535+ this.version = "7.1.4 ";
3948039536 this.license = "gpl";
3948139537 this.templates = {};
3948239538 this.ext = {};
0 commit comments