@urso/core 0.7.0 → 0.7.3
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/README.md +1 -0
- package/build/js/index.js +1 -1
- package/build/js/index.js.LICENSE.txt +222 -38
- package/package.json +2 -2
- package/src/js/components/editor/api.js +34 -14
- package/src/js/lib/objectPool.js +7 -3
- package/src/js/modules/objects/models/dragContainer.js +13 -34
- package/src/js/modules/objects/models/spine.js +25 -2
- package/src/js/modules/objects/propertyAdapter.js +3 -2
- package/src/js/modules/statesManager/action.js +10 -2
|
@@ -3,6 +3,7 @@ class ModulesStatesManagerAction {
|
|
|
3
3
|
constructor(name) {
|
|
4
4
|
this.name = name;
|
|
5
5
|
|
|
6
|
+
this._running = false;
|
|
6
7
|
this._terminating = false;
|
|
7
8
|
this.finished = false;
|
|
8
9
|
this._onFinishCallback = false;
|
|
@@ -12,10 +13,11 @@ class ModulesStatesManagerAction {
|
|
|
12
13
|
|
|
13
14
|
//can we start this action?
|
|
14
15
|
guard() {
|
|
15
|
-
return this.getInstance('Controller').checkActionGuard(this.name);
|
|
16
|
+
return !this._running && this.getInstance('Controller').checkActionGuard(this.name);
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
run(onFinishCallback) {
|
|
20
|
+
this._running = true;
|
|
19
21
|
log(`%c action run ---> ${this.name}`, 'color: blue');
|
|
20
22
|
|
|
21
23
|
this.emit(Urso.events.MODULES_STATES_MANAGER_ACTION_START, this.name);
|
|
@@ -31,6 +33,11 @@ class ModulesStatesManagerAction {
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
terminate() {
|
|
36
|
+
if (!this._running) {
|
|
37
|
+
Urso.logger.warn('ModulesStatesManagerAction: action run from terminating', this.name);
|
|
38
|
+
this.run(() => { });
|
|
39
|
+
}
|
|
40
|
+
|
|
34
41
|
if (this._terminating) {
|
|
35
42
|
Urso.logger.error('ModulesStatesManagerAction: action alredy terminating', this.name);
|
|
36
43
|
return;
|
|
@@ -47,11 +54,12 @@ class ModulesStatesManagerAction {
|
|
|
47
54
|
return;
|
|
48
55
|
}
|
|
49
56
|
|
|
57
|
+
this._running = false;
|
|
50
58
|
this._terminating = false;
|
|
51
59
|
this.finished = true;
|
|
52
60
|
|
|
53
61
|
this.emit(Urso.events.MODULES_STATES_MANAGER_ACTION_FINISH, this.name);
|
|
54
|
-
|
|
62
|
+
|
|
55
63
|
log(`%c action finish <--- ${this.name}`, 'color: blue');
|
|
56
64
|
this._onFinishCallback();
|
|
57
65
|
}
|