1
1
/*
2
2
@license
3
3
4
- dhtmlxGantt v.7.1.9 Standard
4
+ dhtmlxGantt v.7.1.10 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
@@ -8809,7 +8809,11 @@ module.exports = function (gantt) {
8809
8809
this._lightbox_id = null;
8810
8810
store.silent(function () {
8811
8811
store.unselect();
8812
- });
8812
+ }); // GS-1522. If we have multiselect, unselect all previously selected tasks
8813
+
8814
+ if (this.getSelectedTasks) {
8815
+ this._multiselect.reset();
8816
+ }
8813
8817
8814
8818
if (this._tasks_dnd && this._tasks_dnd.drag) {
8815
8819
this._tasks_dnd.drag.id = null;
@@ -9436,7 +9440,17 @@ var DataProcessor = /** @class */ (function () {
9436
9440
this.$gantt.editStop();
9437
9441
}
9438
9442
if (typeof rowId === "undefined" || this._tSend) {
9439
- return this.sendAllData();
9443
+ var updatedTasksAndLinks = this.modes && this.modes["task"] && this.modes["link"] && this.modes["task"].updatedRows.length && this.modes["link"].updatedRows.length; // tslint:disable-line
9444
+ if (updatedTasksAndLinks) {
9445
+ this.setGanttMode("task");
9446
+ this.sendAllData();
9447
+ this.setGanttMode("link");
9448
+ this.sendAllData();
9449
+ return;
9450
+ }
9451
+ else {
9452
+ return this.sendAllData();
9453
+ }
9440
9454
}
9441
9455
if (this._in_progress[rowId]) {
9442
9456
return false;
@@ -13889,10 +13903,31 @@ function _init_tasks_range(gantt) {
13889
13903
13890
13904
var unit = cfg.unit,
13891
13905
step = cfg.step;
13892
- var range = resolveConfigRange(unit, gantt);
13906
+ var range = resolveConfigRange(unit, gantt); // GS-1544: Show correct date range if we have tasks or only projects
13893
13907
13894
13908
if (!(range.start_date && range.end_date)) {
13895
- range = gantt.getSubtaskDates();
13909
+ var onlyProjectTasks = true;
13910
+ var tasks = gantt.getTaskByTime();
13911
+
13912
+ for (var i = 0; i < tasks.length; i++) {
13913
+ var task = tasks[i];
13914
+
13915
+ if (task.type !== gantt.config.types.project) {
13916
+ onlyProjectTasks = false;
13917
+ break;
13918
+ }
13919
+ }
13920
+
13921
+ if (tasks.length && onlyProjectTasks) {
13922
+ var start_date = tasks[0].start_date;
13923
+ var end_date = gantt.date.add(start_date, 1, gantt.config.duration_unit);
13924
+ range = {
13925
+ start_date: new Date(start_date),
13926
+ end_date: new Date(end_date)
13927
+ };
13928
+ } else {
13929
+ range = gantt.getSubtaskDates();
13930
+ }
13896
13931
13897
13932
if (!range.start_date || !range.end_date) {
13898
13933
range = {
@@ -18505,7 +18540,7 @@ function createRowResizer(gantt, grid) {
18505
18540
var store = grid.$config.rowStore;
18506
18541
var config = grid.$getConfig();
18507
18542
var dd = dnd.config;
18508
- var id = parseInt( dd.drag_id, 10) ,
18543
+ var id = dd.drag_id,
18509
18544
itemHeight = grid.getItemHeight(id),
18510
18545
itemTop = grid.getItemTop(id);
18511
18546
var pos = domHelpers.getNodePosition(grid.$grid_data),
@@ -18529,7 +18564,7 @@ function createRowResizer(gantt, grid) {
18529
18564
row_drag_end: gantt.bind(function (dnd, obj, e) {
18530
18565
var store = grid.$config.rowStore;
18531
18566
var dd = dnd.config;
18532
- var id = parseInt( dd.drag_id, 10) ,
18567
+ var id = dd.drag_id,
18533
18568
item = store.getItem(id),
18534
18569
oldItemHeight = grid.getItemHeight(id);
18535
18570
var finalHeight = dd.marker_height;
@@ -18696,7 +18731,8 @@ function _init_dnd(gantt, grid) {
18696
18731
return store.getIdByIndex(index);
18697
18732
}, gantt);
18698
18733
dnd.attachEvent("onDragMove", gantt.bind(function (obj, e) {
18699
- var maxBottom = gantt.$grid_data.getBoundingClientRect().height + (grid.$state.scrollTop || 0);
18734
+ var gridDataSizes = gantt.$grid_data.getBoundingClientRect();
18735
+ var maxBottom = gridDataSizes.height + gridDataSizes.y + (grid.$state.scrollTop || 0) + window.scrollY;
18700
18736
var dd = dnd.config;
18701
18737
18702
18738
var pos = dnd._getGridPos(e);
@@ -18926,10 +18962,15 @@ function _init_dnd(gantt, grid) {
18926
18962
function getTargetTaskId(e) {
18927
18963
var y = domHelpers.getRelativeEventPosition(e, grid.$grid_data).y;
18928
18964
var store = grid.$config.rowStore;
18965
+
18966
+ if (!document.doctype) {
18967
+ y += window.scrollY;
18968
+ }
18969
+
18929
18970
y = y || 0; // limits for the marker according to the layout layer
18930
18971
18931
18972
var scrollPos = grid.$state.scrollTop || 0;
18932
- var maxBottom = gantt.$grid_data.getBoundingClientRect().height + scrollPos;
18973
+ var maxBottom = gantt.$grid_data.getBoundingClientRect().height + scrollPos + window.scrollY ;
18933
18974
var minTop = scrollPos;
18934
18975
var firstVisibleTaskIndex = grid.getItemIndexByTopPosition(grid.$state.scrollTop);
18935
18976
@@ -18979,6 +19020,10 @@ function _init_dnd(gantt, grid) {
18979
19020
var lockLevel = !config.order_branch_free;
18980
19021
var eventTop = domHelpers.getRelativeEventPosition(e, grid.$grid_data).y;
18981
19022
19023
+ if (!document.doctype) {
19024
+ eventTop += window.scrollY;
19025
+ }
19026
+
18982
19027
if (targetTaskId !== store.$getRootId()) {
18983
19028
var rowTop = grid.getItemTop(targetTaskId);
18984
19029
var rowHeight = grid.getItemHeight(targetTaskId);
@@ -19132,7 +19177,6 @@ function highlightPosition(target, root, grid) {
19132
19177
var markerPos = getTaskMarkerPosition(target, grid); // setting position of row
19133
19178
19134
19179
root.marker.style.left = markerPos.x + 9 + "px";
19135
- root.marker.style.top = markerPos.y + "px";
19136
19180
var markerLine = root.markerLine;
19137
19181
19138
19182
if (!markerLine) {
@@ -19164,7 +19208,7 @@ function removeLineHighlight(root) {
19164
19208
19165
19209
function highlightRow(target, markerLine, grid) {
19166
19210
var linePos = getLineMarkerPosition(target, grid);
19167
- var maxBottom = grid.$grid_data.getBoundingClientRect().bottom;
19211
+ var maxBottom = grid.$grid_data.getBoundingClientRect().bottom + window.scrollY ;
19168
19212
markerLine.innerHTML = "<div class='gantt_grid_dnd_marker_line'></div>";
19169
19213
markerLine.style.left = linePos.x + "px";
19170
19214
markerLine.style.height = "4px";
@@ -19185,7 +19229,7 @@ function highlightFolder(target, markerFolder, grid) {
19185
19229
x: 0,
19186
19230
y: grid.getItemTop(id)
19187
19231
}, grid);
19188
- var maxBottom = grid.$grid_data.getBoundingClientRect().bottom;
19232
+ var maxBottom = grid.$grid_data.getBoundingClientRect().bottom + window.scrollY ;
19189
19233
markerFolder.innerHTML = "<div class='gantt_grid_dnd_marker_folder'></div>";
19190
19234
markerFolder.style.width = grid.$grid_data.offsetWidth + "px";
19191
19235
markerFolder.style.top = pos.y + "px";
@@ -25137,6 +25181,10 @@ var TimelineZoom = /** @class */ (function () {
25137
25181
return zoomLevel;
25138
25182
};
25139
25183
this._getVisibleDate = function () {
25184
+ // GS-1450. Don't try to get the visible date if there is no timeline
25185
+ if (!_this.$gantt.$task) {
25186
+ return null;
25187
+ }
25140
25188
var scrollPos = _this.$gantt.getScrollState().x;
25141
25189
var viewPort = _this.$gantt.$task.offsetWidth;
25142
25190
_this._visibleDate = _this.$gantt.dateFromPos(scrollPos + viewPort / 2);
@@ -25148,7 +25196,7 @@ var TimelineZoom = /** @class */ (function () {
25148
25196
var chartConfig = gantt.copy(nextConfig);
25149
25197
delete chartConfig.name;
25150
25198
gantt.mixin(gantt.config, chartConfig, true);
25151
- var isRendered = !!gantt.$root;
25199
+ var isRendered = !!gantt.$root && !!gantt.$task ;
25152
25200
if (isRendered) {
25153
25201
if (cursorOffset) {
25154
25202
var cursorDate = _this.$gantt.dateFromPos(cursorOffset + _this.$gantt.getScrollState().x);
@@ -32248,8 +32296,11 @@ module.exports = function (gantt) {
32248
32296
gantt.attachEvent("onGanttRender", function () {
32249
32297
if (gantt.config.initial_scroll) {
32250
32298
var firstTask = gantt.getTaskByIndex(0);
32251
- var id = firstTask ? firstTask.id : gantt.config.root_id;
32252
- if (gantt.isTaskExists(id)) gantt.showTask(id);
32299
+ var id = firstTask ? firstTask.id : gantt.config.root_id; // GS-1450. Don't scroll to the task if there is no timeline
32300
+
32301
+ if (gantt.isTaskExists(id) && gantt.$task && gantt.utils.dom.isChildOf(gantt.$task, gantt.$container)) {
32302
+ gantt.showTask(id);
32303
+ }
32253
32304
}
32254
32305
}, {
32255
32306
once: true
@@ -33624,8 +33675,10 @@ CalendarWorkTimeStrategy.prototype = {
33624
33675
if (timestamp !== null) {
33625
33676
delete this.getConfig().dates[timestamp];
33626
33677
}
33627
- } // Clear work units cache
33678
+ } // Load updated settings and clear work units cache
33679
+
33628
33680
33681
+ this._parseSettings();
33629
33682
33630
33683
this._clearCaches();
33631
33684
}, this));
@@ -39844,7 +39897,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
39844
39897
39845
39898
function DHXGantt() {
39846
39899
this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
39847
- this.version = "7.1.9 ";
39900
+ this.version = "7.1.10 ";
39848
39901
this.license = "gpl";
39849
39902
this.templates = {};
39850
39903
this.ext = {};
0 commit comments