1
1
/*
2
2
@license
3
3
4
- dhtmlxGantt v.7.0.3 Standard
4
+ dhtmlxGantt v.7.0.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
@@ -8400,6 +8400,7 @@ var DataProcessor = /** @class */ (function () {
8400
8400
if (utils.defined(mode.payload)) {
8401
8401
this._payload = mode.payload;
8402
8402
}
8403
+ this._tSend = !!total;
8403
8404
}
8404
8405
else {
8405
8406
this._tMode = mode;
@@ -8414,7 +8415,12 @@ var DataProcessor = /** @class */ (function () {
8414
8415
this._endnm = true;
8415
8416
this._serializeAsJson = true;
8416
8417
this._headers = this._headers || {};
8417
- this._headers["Content-type"] = "application/json";
8418
+ this._headers["Content-Type"] = "application/json";
8419
+ }
8420
+ else {
8421
+ if (this._headers && !this._headers["Content-Type"]) {
8422
+ this._headers["Content-Type"] = "application/x-www-form-urlencoded";
8423
+ }
8418
8424
}
8419
8425
if (this._tMode === "CUSTOM") {
8420
8426
this._tSend = false;
@@ -10197,7 +10203,10 @@ function initDataStores(gantt){
10197
10203
}
10198
10204
10199
10205
if(action == "add" || action == "move" || action == "delete"){
10200
- gantt.$layout.resize();
10206
+ if(gantt.$layout){
10207
+ gantt.$layout.resize();
10208
+ }
10209
+
10201
10210
}else if(!id){
10202
10211
linksStore.refresh();
10203
10212
}
@@ -11287,12 +11296,18 @@ function extend(gantt){
11287
11296
delete this.$root.gantt;
11288
11297
}
11289
11298
11290
- this._eventRemoveAll();
11299
+ if(this._eventRemoveAll){
11300
+ this._eventRemoveAll();
11301
+ }
11302
+
11291
11303
if(this.$layout){
11292
11304
this.$layout.destructor();
11293
11305
}
11294
11306
11295
- this.resetLightbox();
11307
+ if(this.resetLightbox){
11308
+ this.resetLightbox();
11309
+ }
11310
+
11296
11311
11297
11312
if(this._dp && this._dp.destructor){
11298
11313
this._dp.destructor();
@@ -11479,20 +11494,33 @@ var createDatastoreFacade = function(){
11479
11494
11480
11495
refreshTask: function (taskId, refresh_links) {
11481
11496
var task = this.getTask(taskId);
11482
- if (task && this.isTaskVisible(taskId)) {
11483
-
11484
- this.$data.tasksStore.refresh(taskId, !!this.getState().drag_id);// do quick refresh during drag and drop
11485
-
11497
+ var self = this;
11498
+ function refreshLinks(){
11486
11499
if (refresh_links !== undefined && !refresh_links)
11487
11500
return;
11488
11501
for (var i = 0; i < task.$source.length; i++) {
11489
- this .refreshLink(task.$source[i]);
11502
+ self .refreshLink(task.$source[i]);
11490
11503
}
11491
11504
for (var i = 0; i < task.$target.length; i++) {
11492
- this .refreshLink(task.$target[i]);
11505
+ self .refreshLink(task.$target[i]);
11493
11506
}
11507
+ }
11508
+
11509
+ if (task && this.isTaskVisible(taskId)) {
11510
+ this.$data.tasksStore.refresh(taskId, !!this.getState().drag_id);// do quick refresh during drag and drop
11511
+ refreshLinks();
11494
11512
}else if(this.isTaskExists(taskId) && this.isTaskExists(this.getParent(taskId))){
11495
11513
this.refreshTask(this.getParent(taskId));
11514
+
11515
+ var hasSplitParent = false;
11516
+ this.eachParent(function(parent){
11517
+ if(hasSplitParent || this.isSplitTask(parent)){
11518
+ hasSplitParent = true;
11519
+ }
11520
+ }, taskId);
11521
+ if(hasSplitParent){
11522
+ refreshLinks();
11523
+ }
11496
11524
}
11497
11525
11498
11526
},
@@ -14193,6 +14221,7 @@ function create(gantt){
14193
14221
var updateTaskDateProperties = linkedPropertiesProcessor(gantt);
14194
14222
14195
14223
var handlers = [];
14224
+ var ganttHandlers = [];
14196
14225
var store = null;
14197
14226
var controller = {
14198
14227
_itemId: null,
@@ -14232,6 +14261,12 @@ function create(gantt){
14232
14261
}
14233
14262
}));
14234
14263
14264
+ ganttHandlers.push(gantt.attachEvent("onDataRender", function(){
14265
+ if(self._editor && self._placeholder && !domHelpers.isChildOf(self._placeholder, gantt.$root)){
14266
+ grid.$grid_data.appendChild(self._placeholder);
14267
+ }
14268
+ }));
14269
+
14235
14270
this.init = function(){};
14236
14271
},
14237
14272
@@ -14371,7 +14406,7 @@ function create(gantt){
14371
14406
this._editorType = null;
14372
14407
if (!this._placeholder) return;
14373
14408
14374
- if (this._editor) {
14409
+ if (this._editor && this._editor.hide ) {
14375
14410
this._editor.hide(this._placeholder);
14376
14411
}
14377
14412
this._editor = null;
@@ -14404,7 +14439,7 @@ function create(gantt){
14404
14439
oldValue: this._getItemValue()
14405
14440
};
14406
14441
if (this.callEvent("onBeforeSave", [editorState]) !== false) {
14407
- if (this._editor.is_valid(editorState.newValue, editorState.id, editorState.columnName, this._placeholder)) {
14442
+ if (!this._editor.is_valid || this._editor.is_valid(editorState.newValue, editorState.id, editorState.columnName, this._placeholder)) {
14408
14443
14409
14444
var mapTo = editorConfig.map_to;
14410
14445
var value = editorState.newValue;
@@ -14510,6 +14545,13 @@ function create(gantt){
14510
14545
handlers.forEach(function(handlerId){
14511
14546
store.detachEvent(handlerId);
14512
14547
});
14548
+
14549
+ ganttHandlers.forEach(function(handlerId){
14550
+ gantt.detachEvent(handlerId);
14551
+ });
14552
+ handlers = [];
14553
+ ganttHandlers = [];
14554
+
14513
14555
store = null;
14514
14556
this.hide();
14515
14557
this.detachAllEvents();
@@ -17338,8 +17380,8 @@ var Cell = (function () {
17338
17380
gravity: this.$config.gravity || 1,
17339
17381
minHeight: this.$config.minHeight || 0,
17340
17382
minWidth: this.$config.minWidth || 0,
17341
- maxHeight: this.$config.maxHeight || 100000 ,
17342
- maxWidth: this.$config.maxWidth || 100000
17383
+ maxHeight: this.$config.maxHeight || 100000000000 ,
17384
+ maxWidth: this.$config.maxWidth || 100000000000
17343
17385
};
17344
17386
if (this.$config.collapsed) {
17345
17387
var mode = this.$config.mode === "x";
@@ -17991,9 +18033,9 @@ var Layout = (function (_super) {
17991
18033
this._sizes = [];
17992
18034
var width = 0;
17993
18035
var minWidth = 0;
17994
- var maxWidth = 100000 ;
18036
+ var maxWidth = 100000000000 ;
17995
18037
var height = 0;
17996
- var maxHeight = 100000 ;
18038
+ var maxHeight = 100000000000 ;
17997
18039
var minHeight = 0;
17998
18040
17999
18041
for (var i = 0; i < this.$cells.length; i++) {
@@ -21754,7 +21796,13 @@ module.exports = function(gantt){
21754
21796
return false;
21755
21797
}
21756
21798
21757
- var box = domHelpers.getNodePosition(getAutoscrollContainer());
21799
+ var container = getAutoscrollContainer();
21800
+ if(!container){
21801
+ return;
21802
+ }
21803
+
21804
+ var box = domHelpers.getNodePosition(container);
21805
+
21758
21806
var posX = eventPos.x - box.x;
21759
21807
var posY = eventPos.y - box.y;
21760
21808
@@ -21836,6 +21884,10 @@ module.exports = function(gantt){
21836
21884
}
21837
21885
});
21838
21886
21887
+ gantt.attachEvent("onDestroy", function(){
21888
+ defineScrollInterval(false);
21889
+ });
21890
+
21839
21891
};
21840
21892
21841
21893
/***/ }),
@@ -26219,7 +26271,7 @@ function createTaskDND(timeline, gantt) {
26219
26271
this._domEvents.attach(data, "mousedown", gantt.bind(function(e) {
26220
26272
this.on_mouse_down(e);
26221
26273
}, this));
26222
- this._domEvents.attach(gantt.$root , "mouseup", gantt.bind(function(e) {
26274
+ this._domEvents.attach(document.body , "mouseup", gantt.bind(function(e) {
26223
26275
this.on_mouse_up(e);
26224
26276
}, this));
26225
26277
},
@@ -28687,25 +28739,26 @@ module.exports = function(gantt) {
28687
28739
28688
28740
gantt.locate = function(e) {
28689
28741
var trg = domHelpers.getTargetNode(e);
28690
-
28691
- //ignore empty cells
28692
- var className = domHelpers.getClassName(trg);
28693
- if ((className || "").indexOf("gantt_task_cell") >= 0) return null;
28694
-
28742
+
28743
+ // ignore empty rows/cells of the timeline
28744
+ if(domHelpers.closest(trg, ".gantt_task_row")){
28745
+ return null;
28746
+ }
28747
+
28695
28748
var targetAttribute = arguments[1] || this.config.task_attribute;
28696
-
28749
+
28697
28750
var node = domHelpers.locateAttribute(trg, targetAttribute);
28698
28751
if(node){
28699
28752
return node.getAttribute(targetAttribute);
28700
28753
}else{
28701
28754
return null;
28702
28755
}
28703
28756
};
28704
-
28757
+
28705
28758
gantt._locate_css = function(e, classname, strict){
28706
28759
return domHelpers.locateClassName(e, classname, strict);
28707
28760
};
28708
-
28761
+
28709
28762
gantt._locateHTML = function(e, attribute) {
28710
28763
return domHelpers.locateAttribute(e, attribute || this.config.task_attribute);
28711
28764
};
@@ -29604,6 +29657,9 @@ CalendarWorkTimeStrategy.prototype = {
29604
29657
_getMinutesPerHour: function (date) {
29605
29658
var hourStart = this._getTimeOfDayStamp(date);
29606
29659
var hourEnd = this._getTimeOfDayStamp(this._nextDate(date, "hour", 1));
29660
+ if (hourEnd === 0){
29661
+ hourEnd = 24 * 60 * 60;
29662
+ }
29607
29663
var worktimes = this._getWorkHours(date);
29608
29664
29609
29665
for(var i = 0; i < worktimes.length; i++){
@@ -33252,7 +33308,7 @@ module.exports = function(gantt) {
33252
33308
33253
33309
gantt.scrollTo(null, pos.top - height * 5);
33254
33310
33255
- } else if (gantt.config.show_chart && (pos.left < scroll.x || pos.left > (scroll.x + viewWidth))) {
33311
+ } else if (gantt.config.scroll_on_click && gantt.config. show_chart && (pos.left < scroll.x || pos.left > (scroll.x + viewWidth))) {
33256
33312
gantt.scrollTo(pos.left - gantt.config.task_scroll_offset);
33257
33313
33258
33314
}
@@ -35470,7 +35526,7 @@ exports.Undo = Undo;
35470
35526
35471
35527
function DHXGantt(){
35472
35528
this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
35473
- this.version = "7.0.3 ";
35529
+ this.version = "7.0.4 ";
35474
35530
this.license = "gpl";
35475
35531
this.templates = {};
35476
35532
this.ext = {};
0 commit comments