neo.mjs 4.0.3 → 4.0.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 +1 -1
- package/src/Main.mjs +1 -1
- package/src/layout/Card.mjs +9 -8
package/package.json
CHANGED
package/src/Main.mjs
CHANGED
|
@@ -170,7 +170,7 @@ class Main extends core.Base {
|
|
|
170
170
|
availWidth : screen.availWidth,
|
|
171
171
|
colorDepth : screen.colorDepth,
|
|
172
172
|
height : screen.height,
|
|
173
|
-
orientation: {angle: screen.orientation
|
|
173
|
+
orientation: {angle: screen.orientation?.angle, type: screen.orientation?.type},
|
|
174
174
|
pixelDepth : screen.pixelDepth,
|
|
175
175
|
width : screen.width
|
|
176
176
|
},
|
package/src/layout/Card.mjs
CHANGED
|
@@ -61,11 +61,12 @@ class Card extends Base {
|
|
|
61
61
|
* @protected
|
|
62
62
|
*/
|
|
63
63
|
async afterSetActiveIndex(value, oldValue) {
|
|
64
|
-
let me
|
|
65
|
-
containerId
|
|
66
|
-
container
|
|
67
|
-
sCfg
|
|
68
|
-
needsUpdate
|
|
64
|
+
let me = this,
|
|
65
|
+
containerId = me.containerId,
|
|
66
|
+
container = Neo.getComponent(containerId) || Neo.get(containerId), // the instance might not be registered yet
|
|
67
|
+
sCfg = me.getStaticConfig(),
|
|
68
|
+
needsUpdate = false,
|
|
69
|
+
removeInactiveCards = me.removeInactiveCards,
|
|
69
70
|
cls, i, isActiveIndex, item, items, len, module, proto, vdom;
|
|
70
71
|
|
|
71
72
|
if (Neo.isNumber(value) && container) {
|
|
@@ -119,14 +120,14 @@ class Card extends Base {
|
|
|
119
120
|
NeoArray.remove(cls, isActiveIndex ? sCfg.inactiveItemCls : sCfg.activeItemCls);
|
|
120
121
|
NeoArray.add( cls, isActiveIndex ? sCfg.activeItemCls : sCfg.inactiveItemCls);
|
|
121
122
|
|
|
122
|
-
if (
|
|
123
|
+
if (removeInactiveCards || needsUpdate) {
|
|
123
124
|
item._cls = cls; // silent update
|
|
124
125
|
item.getVdomRoot().cls = cls;
|
|
125
126
|
|
|
126
127
|
if (isActiveIndex) {
|
|
127
128
|
delete item.vdom.removeDom;
|
|
128
129
|
item.activate?.();
|
|
129
|
-
} else {
|
|
130
|
+
} else if (removeInactiveCards) {
|
|
130
131
|
item.mounted = false;
|
|
131
132
|
item.vdom.removeDom = true;
|
|
132
133
|
}
|
|
@@ -136,7 +137,7 @@ class Card extends Base {
|
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
|
|
139
|
-
if (
|
|
140
|
+
if (removeInactiveCards || needsUpdate) {
|
|
140
141
|
container.vdom = vdom;
|
|
141
142
|
}
|
|
142
143
|
}
|