@urso/core 0.8.1 → 0.8.2
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/build/js/index.js +1 -1
- package/package.json +1 -1
- package/src/js/modules/objects/models/button.js +5 -1
- package/src/js/modules/objects/models/checkbox.js +8 -4
- package/src/js/modules/objects/models/hitArea.js +5 -1
- package/src/js/modules/objects/models/slider.js +5 -0
- package/src/js/modules/objects/models/toggle.js +6 -1
package/package.json
CHANGED
|
@@ -36,6 +36,7 @@ class ModulesObjectsModelsButton extends ModulesObjectsBaseModel {
|
|
|
36
36
|
this.mouseOverAction = Urso.helper.recursiveGet('mouseOverAction', params, false);
|
|
37
37
|
this.mouseOutAction = Urso.helper.recursiveGet('mouseOutAction', params, false);
|
|
38
38
|
this.noActionOnMouseOut = Urso.helper.recursiveGet('noActionOnMouseOut', params, this._checkIsDesktop());
|
|
39
|
+
this.handlePointerupoutside = Urso.helper.recursiveGet('handlePointerupoutside', params, true);
|
|
39
40
|
|
|
40
41
|
this.buttonFrames = {
|
|
41
42
|
over: Urso.helper.recursiveGet('buttonFrames.over', params, false),
|
|
@@ -105,10 +106,13 @@ class ModulesObjectsModelsButton extends ModulesObjectsBaseModel {
|
|
|
105
106
|
this._baseObject
|
|
106
107
|
.on('pointerdown', this._onButtonDown.bind(this))
|
|
107
108
|
.on('pointerup', this._onButtonUp.bind(this))
|
|
108
|
-
.on('pointerupoutside', this._onButtonUp.bind(this))
|
|
109
109
|
.on('pointerover', this._onButtonOver.bind(this))
|
|
110
110
|
.on('pointerout', this._onButtonOut.bind(this));
|
|
111
111
|
|
|
112
|
+
if (this.handlePointerupoutside) {
|
|
113
|
+
this._baseObject.on('pointerupoutside', this._onButtonUp.bind(this))
|
|
114
|
+
}
|
|
115
|
+
|
|
112
116
|
};
|
|
113
117
|
|
|
114
118
|
_onButtonDown(event) {
|
|
@@ -21,13 +21,14 @@ class ModulesObjectsModelsCheckbox extends UrsoCoreModulesObjectsModelsToggle {
|
|
|
21
21
|
|
|
22
22
|
this.contents = [];
|
|
23
23
|
|
|
24
|
-
this.action = Urso.helper.recursiveGet('action', params, () => {
|
|
25
|
-
this.emit(Urso.events.MODULES_OBJECTS_CHECKBOX_PRESS, { name: this.name, status: this.status, class: this.class })
|
|
24
|
+
this.action = Urso.helper.recursiveGet('action', params, () => {
|
|
25
|
+
this.emit(Urso.events.MODULES_OBJECTS_CHECKBOX_PRESS, { name: this.name, status: this.status, class: this.class })
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
this.lable = Urso.helper.recursiveGet('lable', params, false);
|
|
29
29
|
|
|
30
30
|
this.defaultStatus = Urso.helper.recursiveGet('defaultStatus', params, 'unpressed'); //pressed or unpressed
|
|
31
|
+
this.handlePointerupoutside = Urso.helper.recursiveGet('handlePointerupoutside', params, true);
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
_createCheckbox() {
|
|
@@ -48,10 +49,13 @@ class ModulesObjectsModelsCheckbox extends UrsoCoreModulesObjectsModelsToggle {
|
|
|
48
49
|
object._baseObject
|
|
49
50
|
.on('pointerdown', this._onButtonDown.bind(this))
|
|
50
51
|
.on('pointerup', this._onButtonUp.bind(this))
|
|
51
|
-
.on('pointerupoutside', this._onButtonUp.bind(this))
|
|
52
52
|
.on('pointerover', this._onButtonOver.bind(this))
|
|
53
53
|
.on('pointerout', this._onButtonOut.bind(this));
|
|
54
54
|
|
|
55
|
+
if (this.handlePointerupoutside) {
|
|
56
|
+
this._baseObject.on('pointerupoutside', this._onButtonUp.bind(this))
|
|
57
|
+
}
|
|
58
|
+
|
|
55
59
|
return object;
|
|
56
60
|
}
|
|
57
61
|
|
|
@@ -85,7 +89,7 @@ class ModulesObjectsModelsCheckbox extends UrsoCoreModulesObjectsModelsToggle {
|
|
|
85
89
|
this._changeTexture(`${this.status}Out`); // load default texture for this key
|
|
86
90
|
return false;
|
|
87
91
|
}
|
|
88
|
-
|
|
92
|
+
|
|
89
93
|
if (this.buttonFrames[key].type === Urso.types.objects.GRAPHICS)
|
|
90
94
|
this._drawGraphics(this.buttonFrames[key].figure);
|
|
91
95
|
else
|
|
@@ -25,6 +25,7 @@ class ModulesObjectsModelsHitArea extends ModulesObjectsBaseModel {
|
|
|
25
25
|
this.onOverCallback = Urso.helper.recursiveGet('onOverCallback', params, false);
|
|
26
26
|
this.onOutCallback = Urso.helper.recursiveGet('onOutCallback', params, false);
|
|
27
27
|
this.onTouchMoveCallback = Urso.helper.recursiveGet('onTouchMoveCallback', params, false);
|
|
28
|
+
this.handlePointerupoutside = Urso.helper.recursiveGet('handlePointerupoutside', params, true);
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
enable() {
|
|
@@ -57,10 +58,13 @@ class ModulesObjectsModelsHitArea extends ModulesObjectsBaseModel {
|
|
|
57
58
|
this._baseObject
|
|
58
59
|
.on('pointerdown', this._onPressDown.bind(this))
|
|
59
60
|
.on('pointerup', this._onPressUp.bind(this))
|
|
60
|
-
.on('pointerupoutside', this._onPressUp.bind(this))
|
|
61
61
|
.on('pointerover', this._onOver.bind(this))
|
|
62
62
|
.on('pointerout', this._onOut.bind(this))
|
|
63
63
|
.on('touchmove', this._onTouchmove.bind(this));
|
|
64
|
+
|
|
65
|
+
if (this.handlePointerupoutside) {
|
|
66
|
+
this._baseObject.on('pointerupoutside', this._onPressUp.bind(this))
|
|
67
|
+
}
|
|
64
68
|
};
|
|
65
69
|
|
|
66
70
|
_onTouchmove(event) {
|
|
@@ -36,6 +36,7 @@ class ModulesObjectsModelsSlider extends ModulesObjectsBaseModel {
|
|
|
36
36
|
this.maxValueTextModel = Urso.helper.recursiveGet('maxValueTextModel', params, false);
|
|
37
37
|
this.currentValueTextModel = Urso.helper.recursiveGet('currentValueTextModel', params, false);
|
|
38
38
|
this.isVertical = Urso.helper.recursiveGet('isVertical', params, false);
|
|
39
|
+
this.handlePointerupoutside = Urso.helper.recursiveGet('handlePointerupoutside', params, true);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/**
|
|
@@ -145,6 +146,10 @@ class ModulesObjectsModelsSlider extends ModulesObjectsBaseModel {
|
|
|
145
146
|
.on('pointerup', this._onPointerUp.bind(this))
|
|
146
147
|
.on('pointerupoutside', this._onPointerUp.bind(this))
|
|
147
148
|
.on('touchmove', this._onTouchmove.bind(this));
|
|
149
|
+
|
|
150
|
+
if (this.handlePointerupoutside) {
|
|
151
|
+
this._baseObject.on('pointerupoutside', this._onPointerUp.bind(this))
|
|
152
|
+
}
|
|
148
153
|
};
|
|
149
154
|
|
|
150
155
|
/**
|
|
@@ -30,6 +30,8 @@ class ModulesObjectsModelsToggle extends UrsoCoreModulesObjectsModelsButton {
|
|
|
30
30
|
pressedDisabled: Urso.helper.recursiveGet('buttonFrames.pressedDisabled', params, false),
|
|
31
31
|
unpressedDisabled: Urso.helper.recursiveGet('buttonFrames.unpressedDisabled', params, false),
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
this.handlePointerupoutside = Urso.helper.recursiveGet('handlePointerupoutside', params, true);
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
setButtonFrame(key, assetKey) {
|
|
@@ -85,9 +87,12 @@ class ModulesObjectsModelsToggle extends UrsoCoreModulesObjectsModelsButton {
|
|
|
85
87
|
this._baseObject
|
|
86
88
|
.on('pointerdown', this._onButtonDown.bind(this))
|
|
87
89
|
.on('pointerup', this._onButtonUp.bind(this))
|
|
88
|
-
.on('pointerupoutside', this._onButtonUp.bind(this))
|
|
89
90
|
.on('pointerover', this._onButtonOver.bind(this))
|
|
90
91
|
.on('pointerout', this._onButtonOut.bind(this));
|
|
92
|
+
|
|
93
|
+
if (this.handlePointerupoutside) {
|
|
94
|
+
this._baseObject.on('pointerupoutside', this._onButtonUp.bind(this))
|
|
95
|
+
}
|
|
91
96
|
};
|
|
92
97
|
|
|
93
98
|
_onButtonDown() {
|