|
1 | 1 | /*
|
2 | 2 | @license
|
3 | 3 |
|
4 |
| -dhtmlxGantt v.8.0.7 Standard |
| 4 | +dhtmlxGantt v.8.0.8 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 |
|
@@ -19231,6 +19231,10 @@ DataStore.prototype = {
|
19231 | 19231 |
|
19232 | 19232 | this._removeItemInner(id);
|
19233 | 19233 |
|
| 19234 | + if (this.isSilent()) { |
| 19235 | + this.callEvent("onAfterSilentDelete", [obj.id, obj]); |
| 19236 | + } |
| 19237 | + |
19234 | 19238 | if (!this.isSilent()) {
|
19235 | 19239 | this.filter();
|
19236 | 19240 | this.callEvent("onAfterDelete", [obj.id, obj]); //repaint signal
|
@@ -19758,6 +19762,9 @@ function initDataStores(gantt) {
|
19758 | 19762 | linksStore.attachEvent("onAfterDelete", function (id, link) {
|
19759 | 19763 | sync_link_delete(link);
|
19760 | 19764 | });
|
| 19765 | + linksStore.attachEvent("onAfterSilentDelete", function (id, link) { |
| 19766 | + sync_link_delete(link); |
| 19767 | + }); |
19761 | 19768 | linksStore.attachEvent("onBeforeIdChange", function (oldId, newId) {
|
19762 | 19769 | sync_link_delete(gantt.mixin({
|
19763 | 19770 | id: oldId
|
@@ -22306,13 +22313,23 @@ module.exports = function (gantt) {
|
22306 | 22313 | this.$root = domHelpers.toNode(node);
|
22307 | 22314 | rebuildLayout();
|
22308 | 22315 | this.$mouseEvents.reset(this.$root);
|
| 22316 | + addMinimalSizes(gantt); |
22309 | 22317 | }
|
22310 | 22318 |
|
22311 | 22319 | this.callEvent("onTemplatesReady", []);
|
22312 | 22320 | this.callEvent("onGanttReady", []);
|
22313 | 22321 | this.render();
|
22314 | 22322 | };
|
22315 | 22323 |
|
| 22324 | + function addMinimalSizes(gantt) { |
| 22325 | + if (gantt.$container && !gantt.config.autosize) { |
| 22326 | + if (gantt.$root.offsetHeight < 50) { |
| 22327 | + // eslint-disable-next-line no-console |
| 22328 | + console.warn("The Gantt container has a small height, so you cannot see its content. If it is not intended, you need to set the 'height' style rule to the container:\nhttps://docs.dhtmlx.com/gantt/faq.html#theganttchartisntrenderedcorrectly"); |
| 22329 | + } |
| 22330 | + } |
| 22331 | + } |
| 22332 | + |
22316 | 22333 | gantt.$click = {
|
22317 | 22334 | buttons: {
|
22318 | 22335 | "edit": function edit(id) {
|
@@ -24680,10 +24697,12 @@ function createHelper(gantt) {
|
24680 | 24697 | }
|
24681 | 24698 |
|
24682 | 24699 | timeoutId = requestAnimationFrame(function () {
|
24683 |
| - var cells = Array.prototype.slice.call(gantt.$container.querySelectorAll(".resourceTimeline_cell [data-assignment-cell]")); |
24684 |
| - cells.forEach(function (cell) { |
24685 |
| - cell.contentEditable = true; |
24686 |
| - }); |
| 24700 | + if (gantt.$container) { |
| 24701 | + var cells = Array.prototype.slice.call(gantt.$container.querySelectorAll(".resourceTimeline_cell [data-assignment-cell]")); |
| 24702 | + cells.forEach(function (cell) { |
| 24703 | + cell.contentEditable = true; |
| 24704 | + }); |
| 24705 | + } |
24687 | 24706 | });
|
24688 | 24707 | return true;
|
24689 | 24708 | }
|
@@ -39201,6 +39220,14 @@ function ScaleHelper(gantt) {
|
39201 | 39220 | var scales;
|
39202 | 39221 |
|
39203 | 39222 | if (legacyMode) {
|
| 39223 | + var docLink = "https://docs.dhtmlx.com/gantt/migrating.html#:~:text=%3D%20false%3B-,Time%20scale%20settings,-Configuration%20of%20time"; |
| 39224 | + |
| 39225 | + if (gantt.env.isFF) { |
| 39226 | + docLink = "https://docs.dhtmlx.com/gantt/migrating.html#6162"; |
| 39227 | + } // eslint-disable-next-line no-console |
| 39228 | + |
| 39229 | + |
| 39230 | + console.warn("You are using the obsolete scale configuration.\nIt will stop working in the future versions.\nPlease migrate the configuration to the newer version:\n".concat(docLink)); |
39204 | 39231 | scales = scaleConfig.subscales || [];
|
39205 | 39232 | } else {
|
39206 | 39233 | scales = scaleConfig.scales.slice(1);
|
@@ -40906,7 +40933,7 @@ module.exports = Timeline;
|
40906 | 40933 | /***/ (function(module, exports) {
|
40907 | 40934 |
|
40908 | 40935 | module.exports = function (gantt) {
|
40909 |
| - gantt.config.touch_drag = 500; //nearly immediate dnd |
| 40936 | + gantt.config.touch_drag = 75; //nearly immediate dnd |
40910 | 40937 |
|
40911 | 40938 | gantt.config.touch = true;
|
40912 | 40939 | gantt.config.touch_feedback = true;
|
@@ -50282,6 +50309,10 @@ var Tooltip = /** @class */ (function () {
|
50282 | 50309 | var node = this.getNode();
|
50283 | 50310 | if (!domHelpers.isChildOf(node, container)) {
|
50284 | 50311 | this.hide();
|
| 50312 | + // GS-2463. Don't put the node beyond the body coordinates |
| 50313 | + // as it may trigger the resize event |
| 50314 | + node.style.top = node.style.top || "0px"; |
| 50315 | + node.style.left = node.style.left || "0px"; |
50285 | 50316 | container.appendChild(node);
|
50286 | 50317 | }
|
50287 | 50318 | if (this._isLikeMouseEvent(left)) {
|
@@ -50979,15 +51010,65 @@ var Monitor = /** @class */ (function () {
|
50979 | 51010 | saveInitialAll();
|
50980 | 51011 | return true;
|
50981 | 51012 | });
|
50982 |
| - gantt.attachEvent("onBeforeTaskDrag", function (taskId) { return _this.store(taskId, gantt.config.undo_types.task); }); |
| 51013 | + var dragId = null; |
| 51014 | + var projectDrag = false; |
| 51015 | + gantt.attachEvent("onBeforeTaskDrag", function (taskId) { |
| 51016 | + dragId = gantt.getState().drag_id; |
| 51017 | + if (dragId === taskId) { |
| 51018 | + var task = gantt.getTask(taskId); |
| 51019 | + if (gantt.isSummaryTask(task) && gantt.config.drag_project) { |
| 51020 | + projectDrag = true; |
| 51021 | + } |
| 51022 | + } |
| 51023 | + // GS-99. Store the initial task dates before multiple drag |
| 51024 | + if (gantt.plugins().multiselect) { |
| 51025 | + var selectedIds = gantt.getSelectedTasks(); |
| 51026 | + if (selectedIds.length > 1) { |
| 51027 | + selectedIds.forEach(function (id) { |
| 51028 | + _this.store(id, gantt.config.undo_types.task, true); |
| 51029 | + }); |
| 51030 | + } |
| 51031 | + } |
| 51032 | + return _this.store(taskId, gantt.config.undo_types.task); |
| 51033 | + }); |
| 51034 | + gantt.attachEvent("onAfterTaskDrag", function (taskId) { |
| 51035 | + // if we drag multiple tasks and other tasks move to another date after that, |
| 51036 | + // auto-scheduling/correct work time should occur in anoher command. |
| 51037 | + // otherwise, when we undo the changes, the task constraint is not restored correctly |
| 51038 | + var multipleDrag = projectDrag || (gantt.plugins().multiselect && gantt.getSelectedTasks().length > 1); |
| 51039 | + if (multipleDrag && dragId === taskId) { |
| 51040 | + projectDrag = false; |
| 51041 | + dragId = null; |
| 51042 | + _this.stopBatchAction(); |
| 51043 | + } |
| 51044 | + // GS-99. When dragging multiple tasks, we need to store the initial tasks |
| 51045 | + _this.store(taskId, gantt.config.undo_types.task, true); |
| 51046 | + }); |
50983 | 51047 | gantt.attachEvent("onLightbox", function (taskId) { return _this.store(taskId, gantt.config.undo_types.task); });
|
50984 | 51048 | gantt.attachEvent("onBeforeTaskAutoSchedule", function (task) {
|
50985 |
| - _this.store(task.id, gantt.config.undo_types.task); |
| 51049 | + _this.store(task.id, gantt.config.undo_types.task, true); |
50986 | 51050 | return true;
|
50987 | 51051 | });
|
50988 | 51052 | if (gantt.ext.inlineEditors) {
|
50989 |
| - gantt.ext.inlineEditors.attachEvent("onEditStart", function (state) { |
50990 |
| - _this.store(state.id, gantt.config.undo_types.task); |
| 51053 | + // remove the onGanttLayoutReady wrapper when GS-1288 is merged |
| 51054 | + var onBeforeEditStartId_1 = null; |
| 51055 | + var onEditStart_1 = null; |
| 51056 | + gantt.attachEvent("onGanttLayoutReady", function () { |
| 51057 | + if (onBeforeEditStartId_1) { |
| 51058 | + gantt.ext.inlineEditors.detachEvent(onBeforeEditStartId_1); |
| 51059 | + } |
| 51060 | + if (onEditStart_1) { |
| 51061 | + gantt.ext.inlineEditors.detachEvent(onEditStart_1); |
| 51062 | + } |
| 51063 | + onEditStart_1 = gantt.ext.inlineEditors.attachEvent("onEditStart", function (state) { |
| 51064 | + _this.store(state.id, gantt.config.undo_types.task); |
| 51065 | + }); |
| 51066 | + // GS-99. If another inline editor is opened and we open a new inline editor, |
| 51067 | + // we shouldn't use the batchAction |
| 51068 | + onBeforeEditStartId_1 = gantt.ext.inlineEditors.attachEvent("onBeforeEditStart", function (state) { |
| 51069 | + _this.stopBatchAction(); |
| 51070 | + return true; |
| 51071 | + }); |
50991 | 51072 | });
|
50992 | 51073 | }
|
50993 | 51074 | };
|
@@ -51261,6 +51342,9 @@ var Undo = /** @class */ (function () {
|
51261 | 51342 | isExists: "isLinkExists"
|
51262 | 51343 | };
|
51263 | 51344 | gantt.batchUpdate(function () {
|
| 51345 | + // it is logical to undo actions from the last one to the first one |
| 51346 | + // but we have to do it from the first one because the order |
| 51347 | + // of tasks ($index and $local_index) depends on the existing tasks |
51264 | 51348 | for (var i = 0; i < action.commands.length; i++) {
|
51265 | 51349 | command = action.commands[i];
|
51266 | 51350 | var method = methods[command.entity][command.type];
|
@@ -51309,7 +51393,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
|
51309 | 51393 |
|
51310 | 51394 | function DHXGantt() {
|
51311 | 51395 | this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
|
51312 |
| - this.version = "8.0.7"; |
| 51396 | + this.version = "8.0.8"; |
51313 | 51397 | this.license = "gpl";
|
51314 | 51398 | this.templates = {};
|
51315 | 51399 | this.ext = {};
|
|
0 commit comments