11/*
22@license
33
4- dhtmlxGantt v.7.1.9 Standard
4+ dhtmlxGantt v.7.1.10 Standard
55
66This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77
@@ -8809,7 +8809,11 @@ module.exports = function (gantt) {
88098809 this._lightbox_id = null;
88108810 store.silent(function () {
88118811 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+ }
88138817
88148818 if (this._tasks_dnd && this._tasks_dnd.drag) {
88158819 this._tasks_dnd.drag.id = null;
@@ -9436,7 +9440,17 @@ var DataProcessor = /** @class */ (function () {
94369440 this.$gantt.editStop();
94379441 }
94389442 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+ }
94409454 }
94419455 if (this._in_progress[rowId]) {
94429456 return false;
@@ -13889,10 +13903,31 @@ function _init_tasks_range(gantt) {
1388913903
1389013904 var unit = cfg.unit,
1389113905 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
1389313907
1389413908 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+ }
1389613931
1389713932 if (!range.start_date || !range.end_date) {
1389813933 range = {
@@ -18505,7 +18540,7 @@ function createRowResizer(gantt, grid) {
1850518540 var store = grid.$config.rowStore;
1850618541 var config = grid.$getConfig();
1850718542 var dd = dnd.config;
18508- var id = parseInt( dd.drag_id, 10) ,
18543+ var id = dd.drag_id,
1850918544 itemHeight = grid.getItemHeight(id),
1851018545 itemTop = grid.getItemTop(id);
1851118546 var pos = domHelpers.getNodePosition(grid.$grid_data),
@@ -18529,7 +18564,7 @@ function createRowResizer(gantt, grid) {
1852918564 row_drag_end: gantt.bind(function (dnd, obj, e) {
1853018565 var store = grid.$config.rowStore;
1853118566 var dd = dnd.config;
18532- var id = parseInt( dd.drag_id, 10) ,
18567+ var id = dd.drag_id,
1853318568 item = store.getItem(id),
1853418569 oldItemHeight = grid.getItemHeight(id);
1853518570 var finalHeight = dd.marker_height;
@@ -18696,7 +18731,8 @@ function _init_dnd(gantt, grid) {
1869618731 return store.getIdByIndex(index);
1869718732 }, gantt);
1869818733 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;
1870018736 var dd = dnd.config;
1870118737
1870218738 var pos = dnd._getGridPos(e);
@@ -18926,10 +18962,15 @@ function _init_dnd(gantt, grid) {
1892618962 function getTargetTaskId(e) {
1892718963 var y = domHelpers.getRelativeEventPosition(e, grid.$grid_data).y;
1892818964 var store = grid.$config.rowStore;
18965+
18966+ if (!document.doctype) {
18967+ y += window.scrollY;
18968+ }
18969+
1892918970 y = y || 0; // limits for the marker according to the layout layer
1893018971
1893118972 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 ;
1893318974 var minTop = scrollPos;
1893418975 var firstVisibleTaskIndex = grid.getItemIndexByTopPosition(grid.$state.scrollTop);
1893518976
@@ -18979,6 +19020,10 @@ function _init_dnd(gantt, grid) {
1897919020 var lockLevel = !config.order_branch_free;
1898019021 var eventTop = domHelpers.getRelativeEventPosition(e, grid.$grid_data).y;
1898119022
19023+ if (!document.doctype) {
19024+ eventTop += window.scrollY;
19025+ }
19026+
1898219027 if (targetTaskId !== store.$getRootId()) {
1898319028 var rowTop = grid.getItemTop(targetTaskId);
1898419029 var rowHeight = grid.getItemHeight(targetTaskId);
@@ -19132,7 +19177,6 @@ function highlightPosition(target, root, grid) {
1913219177 var markerPos = getTaskMarkerPosition(target, grid); // setting position of row
1913319178
1913419179 root.marker.style.left = markerPos.x + 9 + "px";
19135- root.marker.style.top = markerPos.y + "px";
1913619180 var markerLine = root.markerLine;
1913719181
1913819182 if (!markerLine) {
@@ -19164,7 +19208,7 @@ function removeLineHighlight(root) {
1916419208
1916519209function highlightRow(target, markerLine, grid) {
1916619210 var linePos = getLineMarkerPosition(target, grid);
19167- var maxBottom = grid.$grid_data.getBoundingClientRect().bottom;
19211+ var maxBottom = grid.$grid_data.getBoundingClientRect().bottom + window.scrollY ;
1916819212 markerLine.innerHTML = "<div class='gantt_grid_dnd_marker_line'></div>";
1916919213 markerLine.style.left = linePos.x + "px";
1917019214 markerLine.style.height = "4px";
@@ -19185,7 +19229,7 @@ function highlightFolder(target, markerFolder, grid) {
1918519229 x: 0,
1918619230 y: grid.getItemTop(id)
1918719231 }, grid);
19188- var maxBottom = grid.$grid_data.getBoundingClientRect().bottom;
19232+ var maxBottom = grid.$grid_data.getBoundingClientRect().bottom + window.scrollY ;
1918919233 markerFolder.innerHTML = "<div class='gantt_grid_dnd_marker_folder'></div>";
1919019234 markerFolder.style.width = grid.$grid_data.offsetWidth + "px";
1919119235 markerFolder.style.top = pos.y + "px";
@@ -25137,6 +25181,10 @@ var TimelineZoom = /** @class */ (function () {
2513725181 return zoomLevel;
2513825182 };
2513925183 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+ }
2514025188 var scrollPos = _this.$gantt.getScrollState().x;
2514125189 var viewPort = _this.$gantt.$task.offsetWidth;
2514225190 _this._visibleDate = _this.$gantt.dateFromPos(scrollPos + viewPort / 2);
@@ -25148,7 +25196,7 @@ var TimelineZoom = /** @class */ (function () {
2514825196 var chartConfig = gantt.copy(nextConfig);
2514925197 delete chartConfig.name;
2515025198 gantt.mixin(gantt.config, chartConfig, true);
25151- var isRendered = !!gantt.$root;
25199+ var isRendered = !!gantt.$root && !!gantt.$task ;
2515225200 if (isRendered) {
2515325201 if (cursorOffset) {
2515425202 var cursorDate = _this.$gantt.dateFromPos(cursorOffset + _this.$gantt.getScrollState().x);
@@ -32248,8 +32296,11 @@ module.exports = function (gantt) {
3224832296 gantt.attachEvent("onGanttRender", function () {
3224932297 if (gantt.config.initial_scroll) {
3225032298 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+ }
3225332304 }
3225432305 }, {
3225532306 once: true
@@ -33624,8 +33675,10 @@ CalendarWorkTimeStrategy.prototype = {
3362433675 if (timestamp !== null) {
3362533676 delete this.getConfig().dates[timestamp];
3362633677 }
33627- } // Clear work units cache
33678+ } // Load updated settings and clear work units cache
33679+
3362833680
33681+ this._parseSettings();
3362933682
3363033683 this._clearCaches();
3363133684 }, this));
@@ -39844,7 +39897,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
3984439897
3984539898function DHXGantt() {
3984639899 this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
39847- this.version = "7.1.9 ";
39900+ this.version = "7.1.10 ";
3984839901 this.license = "gpl";
3984939902 this.templates = {};
3985039903 this.ext = {};
0 commit comments