1
1
/*
2
2
@license
3
3
4
- dhtmlxGantt v.7.1.3 Standard
4
+ dhtmlxGantt v.7.1.4 Standard
5
5
6
6
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
7
7
@@ -13605,8 +13605,10 @@ module.exports = function (gantt) {
13605
13605
if (this.$root) {
13606
13606
if (this.config.rtl) {
13607
13607
this.$root.classList.add("gantt_rtl");
13608
+ this.$root.firstChild.classList.add("gantt_rtl"); // GS-1499
13608
13609
} else {
13609
13610
this.$root.classList.remove("gantt_rtl");
13611
+ this.$root.firstChild.classList.remove("gantt_rtl"); // GS-1499
13610
13612
}
13611
13613
}
13612
13614
@@ -14347,33 +14349,54 @@ module.exports = function (gantt) {
14347
14349
};
14348
14350
}
14349
14351
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);
14355
14355
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
+ }
14357
14364
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
+ }
14361
14373
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
+ }
14364
14381
}
14365
14382
}
14366
14383
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
+ }
14371
14388
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
+ });
14374
14395
}
14375
14396
}
14376
14397
14398
+ var delTaskParent;
14399
+
14377
14400
function updateTaskType(task, targetType) {
14378
14401
if (!gantt.getState().group_mode) {
14379
14402
task.type = targetType;
@@ -14400,6 +14423,11 @@ module.exports = function (gantt) {
14400
14423
var isParsingDone = true;
14401
14424
gantt.attachEvent("onParse", callIfEnabled(function () {
14402
14425
isParsingDone = false;
14426
+
14427
+ if (gantt.getState().group_mode) {
14428
+ return;
14429
+ }
14430
+
14403
14431
gantt.batchUpdate(function () {
14404
14432
gantt.eachTask(function (task) {
14405
14433
var targetType = getTaskTypeToUpdate(task);
@@ -14413,18 +14441,18 @@ module.exports = function (gantt) {
14413
14441
}));
14414
14442
gantt.attachEvent("onAfterTaskAdd", callIfEnabled(function (id) {
14415
14443
if (isParsingDone) {
14416
- updateParents (id);
14444
+ updateParentTypes (id);
14417
14445
}
14418
14446
}));
14419
14447
gantt.attachEvent("onAfterTaskUpdate", callIfEnabled(function (id) {
14420
14448
if (isParsingDone) {
14421
- updateParents (id);
14449
+ updateParentTypes (id);
14422
14450
}
14423
14451
}));
14424
14452
14425
14453
function updateAfterRemoveChild(id) {
14426
14454
if (id != gantt.config.root_id && gantt.isTaskExists(id)) {
14427
- updateParents (id);
14455
+ updateParentTypes (id);
14428
14456
}
14429
14457
}
14430
14458
@@ -14442,7 +14470,7 @@ module.exports = function (gantt) {
14442
14470
}));
14443
14471
gantt.attachEvent("onRowDragEnd", callIfEnabled(function (id, target) {
14444
14472
updateAfterRemoveChild(originalRowDndParent);
14445
- updateParents (id);
14473
+ updateParentTypes (id);
14446
14474
}));
14447
14475
var originalMoveTaskParent;
14448
14476
gantt.attachEvent("onBeforeTaskMove", callIfEnabled(function (sid, parent, tindex) {
@@ -14456,7 +14484,7 @@ module.exports = function (gantt) {
14456
14484
}
14457
14485
14458
14486
updateAfterRemoveChild(originalMoveTaskParent);
14459
- updateParents (id);
14487
+ updateParentTypes (id);
14460
14488
}));
14461
14489
};
14462
14490
@@ -16542,18 +16570,34 @@ function create(gantt) {
16542
16570
16543
16571
return nextItem;
16544
16572
},
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
+ }
16547
16583
16548
- if (row ) {
16549
- this.startEdit(row , this._columnName);
16584
+ if (gantt.isTaskExists(next) ) {
16585
+ this.startEdit(next , this._columnName);
16550
16586
}
16551
16587
},
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;
16554
16592
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);
16557
16601
}
16558
16602
},
16559
16603
destructor: function destructor() {
@@ -26180,7 +26224,7 @@ function generateRenderResourceHistogram(gantt) {
26180
26224
26181
26225
var capacityElement = renderHistogramLine(capacityMatrix, timeline, maxCapacity, viewport);
26182
26226
26183
- if (capacityElement) {
26227
+ if (capacityElement && sizes ) {
26184
26228
capacityElement.setAttribute("data-resource-id", resource.id);
26185
26229
capacityElement.setAttribute(timeline.$config.item_attribute, resource.id);
26186
26230
capacityElement.style.position = "absolute";
@@ -29680,8 +29724,8 @@ function createTaskDND(timeline, gantt) {
29680
29724
this._finalize_mouse_up(drag.id, config, drag, e);
29681
29725
};
29682
29726
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
29685
29729
gantt.batchUpdate(function () {
29686
29730
doFinalize.call(this);
29687
29731
}.bind(this));
@@ -35281,6 +35325,8 @@ var SelectedRegion = /** @class */ (function () {
35281
35325
}
35282
35326
this._viewPort.callEvent("onBeforeDragEnd", [this._startPoint, endPoint]);
35283
35327
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;
35284
35330
if (this._startDate.valueOf() > this._endDate.valueOf()) {
35285
35331
_a = [this._endDate, this._startDate], this._startDate = _a[0], this._endDate = _a[1];
35286
35332
}
@@ -37211,8 +37257,15 @@ module.exports = function (gantt) {
37211
37257
37212
37258
if (pos.top < scroll.y || pos.top + height > scroll.y + viewHeight) {
37213
37259
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
+ }
37216
37269
}
37217
37270
}
37218
37271
@@ -37938,10 +37991,13 @@ function default_1(gantt) {
37938
37991
return gantt.templates.task_time(start, end, ev);
37939
37992
};
37940
37993
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
+ }
37945
38001
return true;
37946
38002
});
37947
38003
var events = ["onViewChange", "onLightbox", "onBeforeTaskDelete", "onBeforeDrag"];
@@ -39476,7 +39532,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
39476
39532
39477
39533
function DHXGantt() {
39478
39534
this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
39479
- this.version = "7.1.3 ";
39535
+ this.version = "7.1.4 ";
39480
39536
this.license = "gpl";
39481
39537
this.templates = {};
39482
39538
this.ext = {};
0 commit comments