@urso/core 0.5.3 → 0.5.4
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
CHANGED
|
@@ -4,18 +4,21 @@ class ModulesObjectsModelsScrollbox extends Urso.Core.Modules.Objects.BaseModel
|
|
|
4
4
|
|
|
5
5
|
this.type = Urso.types.objects.SCROLLBOX;
|
|
6
6
|
this._addBaseObject();
|
|
7
|
-
this.
|
|
7
|
+
this._createScrollContent();
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
setupParams(params) {
|
|
11
11
|
super.setupParams(params);
|
|
12
12
|
|
|
13
|
-
this.
|
|
13
|
+
this.scrollContent = Urso.helper.recursiveGet('scrollContent', params, []);
|
|
14
14
|
this.dragScroll = Urso.helper.recursiveGet('dragScroll', params, true);
|
|
15
|
-
this.scrollType = Urso.helper.recursiveGet('scrollType', params,
|
|
15
|
+
this.scrollType = Urso.helper.recursiveGet('scrollType', params, 'auto'); // hidden / hiddenVertical / hiddenHorizontal / auto
|
|
16
|
+
|
|
17
|
+
this.width = Urso.helper.recursiveGet('width', params, false); //number format
|
|
18
|
+
this.height = Urso.helper.recursiveGet('height', params, false); //number format
|
|
16
19
|
}
|
|
17
20
|
|
|
18
|
-
_getScrollboxParams(){
|
|
21
|
+
_getScrollboxParams() {
|
|
19
22
|
return {
|
|
20
23
|
boxWidth: this.width,
|
|
21
24
|
boxHeight: this.height,
|
|
@@ -25,25 +28,25 @@ class ModulesObjectsModelsScrollbox extends Urso.Core.Modules.Objects.BaseModel
|
|
|
25
28
|
}
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
_setScrollWidth(){
|
|
29
|
-
if(this.scrollType ===
|
|
31
|
+
_setScrollWidth() {
|
|
32
|
+
if (this.scrollType === 'hiddenHorizontal' || this.scrollType === 'hidden') {
|
|
30
33
|
this._baseObject.scrollWidth = this.width;
|
|
31
34
|
this._baseObject.overflowX = 'hidden';
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
37
|
|
|
35
|
-
_setScrollHeight(){
|
|
36
|
-
if(this.scrollType ===
|
|
38
|
+
_setScrollHeight() {
|
|
39
|
+
if (this.scrollType === 'hiddenVertical' || this.scrollType === 'hidden') {
|
|
37
40
|
this._baseObject.scrollHeight = this.height;
|
|
38
|
-
this._baseObject.overflowY = 'hidden'
|
|
41
|
+
this._baseObject.overflowY = 'hidden';
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
this.
|
|
44
|
-
let object = Urso.objects.create(child)
|
|
45
|
-
this._baseObject.content.addChild(object._baseObject)
|
|
46
|
-
})
|
|
45
|
+
_createScrollContent() {
|
|
46
|
+
this.scrollContent.forEach(child => {
|
|
47
|
+
let object = Urso.objects.create(child);
|
|
48
|
+
this._baseObject.content.addChild(object._baseObject);
|
|
49
|
+
});
|
|
47
50
|
|
|
48
51
|
this._baseObject.update();
|
|
49
52
|
}
|