targetj 1.0.55 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/App.js +1 -0
- package/src/LocationManager.js +3 -3
- package/src/TModel.js +7 -7
- package/src/TModelManager.js +16 -2
- package/src/TargetManager.js +7 -4
- package/src/TargetUtil.js +3 -3
- package/webpack.config.js +1 -1
package/package.json
CHANGED
package/src/App.js
CHANGED
package/src/LocationManager.js
CHANGED
|
@@ -138,11 +138,11 @@ LocationManager.prototype.calculateContainer = function(container) {
|
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
LocationManager.prototype.calculateTargets = function(tmodel) {
|
|
141
|
-
tapp.targetManager.setTargetValues(tmodel, Object.keys(tmodel.
|
|
141
|
+
tapp.targetManager.setTargetValues(tmodel, Object.keys(tmodel.activeTargetMap));
|
|
142
142
|
tapp.targetManager.setActualValues(tmodel);
|
|
143
143
|
|
|
144
|
-
if ((!TUtil.isDefined(tmodel.targetValues.width) || tmodel.
|
|
145
|
-
if ((!TUtil.isDefined(tmodel.targetValues.height) || tmodel.
|
|
144
|
+
if ((!TUtil.isDefined(tmodel.targetValues.width) || tmodel.getTargetValue('widthFromDom')) && tmodel.hasDom()) TargetUtil.setWidthFromDom(tmodel);
|
|
145
|
+
if ((!TUtil.isDefined(tmodel.targetValues.height) || tmodel.getTargetValue('heightFromDom')) && tmodel.hasDom()) TargetUtil.setHeightFromDom(tmodel);
|
|
146
146
|
};
|
|
147
147
|
|
|
148
148
|
LocationManager.prototype.addToLocationList = function(child) {
|
package/src/TModel.js
CHANGED
|
@@ -15,7 +15,7 @@ function TModel(type, targets) {
|
|
|
15
15
|
|
|
16
16
|
this.type = type ? type : 'blank';
|
|
17
17
|
this.targets = Object.assign({}, targets);
|
|
18
|
-
this.
|
|
18
|
+
this.activeTargetMap = {};
|
|
19
19
|
this.resetActiveTargetMap();
|
|
20
20
|
|
|
21
21
|
var uniqueId = App.getOid(this.type);
|
|
@@ -114,9 +114,9 @@ TModel.prototype.getDomHolder = function() {
|
|
|
114
114
|
TModel.prototype.resetActiveTargetMap = function() {
|
|
115
115
|
var self = this;
|
|
116
116
|
this.targetValues = {};
|
|
117
|
-
this.
|
|
117
|
+
this.activeTargetMap = {};
|
|
118
118
|
Object.keys(this.targets).forEach(function(key) {
|
|
119
|
-
self.
|
|
119
|
+
self.activeTargetMap[key] = true;
|
|
120
120
|
});
|
|
121
121
|
};
|
|
122
122
|
|
|
@@ -727,7 +727,7 @@ TModel.prototype.setTargetValue = function(key, value, steps, stepInterval, cycl
|
|
|
727
727
|
TargetUtil.handleValueChange(this, key, this.actualValues[key], oldValue, 0, 0);
|
|
728
728
|
}
|
|
729
729
|
|
|
730
|
-
this.
|
|
730
|
+
this.activeTargetMap[key] = true;
|
|
731
731
|
this.targetValues[key].executionCount++;
|
|
732
732
|
|
|
733
733
|
this.updateTargetStatus(key);
|
|
@@ -772,13 +772,13 @@ TModel.prototype.removeUpdatingChild = function(child) {
|
|
|
772
772
|
|
|
773
773
|
TModel.prototype.removeTarget = function(key) {
|
|
774
774
|
delete this.targets[key];
|
|
775
|
-
delete this.
|
|
775
|
+
delete this.activeTargetMap[key];
|
|
776
776
|
delete this.targetValues[key];
|
|
777
777
|
};
|
|
778
778
|
|
|
779
779
|
TModel.prototype.addTarget = function(key, target) {
|
|
780
780
|
this.targets[key] = target;
|
|
781
|
-
this.
|
|
781
|
+
this.activeTargetMap[key] = true;
|
|
782
782
|
delete this.targetValues[key];
|
|
783
783
|
|
|
784
784
|
tapp.manager.scheduleRun(10, 'addTarget-' + this.oid + "-" + key);
|
|
@@ -793,7 +793,7 @@ TModel.prototype.addTargets = function(targets) {
|
|
|
793
793
|
|
|
794
794
|
TModel.prototype.deleteTargetValue = function(key) {
|
|
795
795
|
delete this.targetValues[key];
|
|
796
|
-
this.
|
|
796
|
+
this.activeTargetMap[key] = true;
|
|
797
797
|
|
|
798
798
|
tapp.manager.scheduleRun(10, 'deleteTargetValue-' + this.oid + "-" + key);
|
|
799
799
|
};
|
package/src/TModelManager.js
CHANGED
|
@@ -14,7 +14,8 @@ TModelManager.prototype.init = function() {
|
|
|
14
14
|
deletedTModel: [],
|
|
15
15
|
visibleNoDom: [],
|
|
16
16
|
updatingTModels: [],
|
|
17
|
-
updatingTargets: []
|
|
17
|
+
updatingTargets: [],
|
|
18
|
+
activeTargets: []
|
|
18
19
|
};
|
|
19
20
|
this.visibleTypeMap = {};
|
|
20
21
|
this.visibleOidMap = {};
|
|
@@ -23,6 +24,7 @@ TModelManager.prototype.init = function() {
|
|
|
23
24
|
this.nextRuns = [];
|
|
24
25
|
this.runningStep = 0;
|
|
25
26
|
this.runningFlag = false;
|
|
27
|
+
this.rerunFlag = false;
|
|
26
28
|
};
|
|
27
29
|
|
|
28
30
|
TModelManager.prototype.visibles = function(type, list) {
|
|
@@ -47,6 +49,7 @@ TModelManager.prototype.analyze = function() {
|
|
|
47
49
|
this.lists.visibleNoDom.length = 0;
|
|
48
50
|
this.lists.updatingTModels.length = 0;
|
|
49
51
|
this.lists.updatingTargets.length = 0;
|
|
52
|
+
this.lists.activeTargets.length = 0;
|
|
50
53
|
this.visibleTypeMap = {};
|
|
51
54
|
this.visibleOidMap = {};
|
|
52
55
|
this.targetMethodMap = {};
|
|
@@ -72,6 +75,11 @@ TModelManager.prototype.analyze = function() {
|
|
|
72
75
|
this.lists.updatingTModels.push(tmodel);
|
|
73
76
|
this.lists.updatingTargets = this.lists.updatingTargets.concat((tmodel.targetUpdatingList));
|
|
74
77
|
}
|
|
78
|
+
|
|
79
|
+
var activeTargets = Object.keys(tmodel.activeTargetMap);
|
|
80
|
+
if (activeTargets.length > 0) {
|
|
81
|
+
this.lists.activeTargets = this.lists.activeTargets.concat("'" + tmodel.oid + "'", activeTargets);
|
|
82
|
+
}
|
|
75
83
|
|
|
76
84
|
if (Object.keys(tmodel.targetMethodMap).length > 0) {
|
|
77
85
|
this.targetMethodMap[tmodel.oid] = Object.assign({}, tmodel.targetMethodMap);
|
|
@@ -147,7 +155,7 @@ TModelManager.prototype.deleteDoms = function () {
|
|
|
147
155
|
var key = invisible.key;
|
|
148
156
|
invisible.fn.call(tmodel, key, tmodel.getTargetStep(key), tmodel.getTargetCycle(key), tmodel.getTargetSteps(key), tmodel.getTargetCycles(key));
|
|
149
157
|
tmodel.setTargetMethodName(key, 'onInvisible');
|
|
150
|
-
tmodel.
|
|
158
|
+
tmodel.activeTargetMap[key] = true;
|
|
151
159
|
});
|
|
152
160
|
}
|
|
153
161
|
|
|
@@ -295,6 +303,8 @@ TModelManager.prototype.scheduleRun = function(delay, oid) {
|
|
|
295
303
|
var lastRun = this.nextRuns.length > 0 ? this.nextRuns[this.nextRuns.length - 1] : null;
|
|
296
304
|
if (nextRun && (!lastRun || nextRun.delay > lastRun.delay)) {
|
|
297
305
|
this.nextRuns.push(nextRun);
|
|
306
|
+
} else if (nextRun && lastRun && nextRun.delay <= lastRun.delay) {
|
|
307
|
+
tapp.manager.rerunFlag = true;
|
|
298
308
|
}
|
|
299
309
|
}
|
|
300
310
|
};
|
|
@@ -390,6 +400,10 @@ TModelManager.prototype.run = function(oid, delay) {
|
|
|
390
400
|
|
|
391
401
|
if (tapp.manager.runningStep !== 7) {
|
|
392
402
|
tapp.manager.run("rendering: " + tapp.manager.runningStep);
|
|
403
|
+
} else if (tapp.manager.rerunFlag) {
|
|
404
|
+
tapp.manager.runningStep = 0;
|
|
405
|
+
tapp.manager.rerunFlag = false;
|
|
406
|
+
tapp.manager.run("rerun");
|
|
393
407
|
} else {
|
|
394
408
|
tapp.manager.runningStep = 0;
|
|
395
409
|
|
package/src/TargetManager.js
CHANGED
|
@@ -32,7 +32,7 @@ TargetManager.prototype.setTargetValues = function(tmodel, activeKeys) {
|
|
|
32
32
|
if (tmodel.isTargetDone(key)) {
|
|
33
33
|
this.doneTargets.push({ tmodel: tmodel, key: key });
|
|
34
34
|
} else if (tmodel.isTargetComplete(key)) {
|
|
35
|
-
delete tmodel.
|
|
35
|
+
delete tmodel.activeTargetMap[key];
|
|
36
36
|
} else {
|
|
37
37
|
this.setTargetValue(tmodel, key);
|
|
38
38
|
tmodel.updateTargetStatus(key);
|
|
@@ -54,7 +54,7 @@ TargetManager.prototype.setTargetValue = function(tmodel, key) {
|
|
|
54
54
|
var target = tmodel.targets[key];
|
|
55
55
|
|
|
56
56
|
if (!TUtil.isDefined(target)) {
|
|
57
|
-
delete tmodel.
|
|
57
|
+
delete tmodel.activeTargetMap[key];
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -65,10 +65,13 @@ TargetManager.prototype.setTargetValue = function(tmodel, key) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
if (!TUtil.isDefined(tmodel.getScheduleTimeStamp(key))) {
|
|
68
|
-
TargetUtil.assignValueArray(tmodel, key);
|
|
68
|
+
var newChange = TargetUtil.assignValueArray(tmodel, key);
|
|
69
|
+
if (!newChange) {
|
|
70
|
+
tmodel.targetValues[key].executionCount++;
|
|
71
|
+
}
|
|
69
72
|
tmodel.setTargetMethodName(key, 'value');
|
|
70
73
|
}
|
|
71
|
-
|
|
74
|
+
|
|
72
75
|
var schedulePeriod = TargetUtil.scheduleExecution(tmodel, key);
|
|
73
76
|
if (schedulePeriod > 0) {
|
|
74
77
|
tapp.manager.scheduleRun(schedulePeriod, "actualInterval__" + tmodel.oid + "__" + key);
|
package/src/TargetUtil.js
CHANGED