@neovici/cosmoz-bottom-bar 6.2.0 → 6.3.0
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/cosmoz-bottom-bar.js +19 -4
- package/package.json +1 -1
package/cosmoz-bottom-bar.js
CHANGED
|
@@ -290,10 +290,25 @@ class CosmozBottomBar extends PolymerElement {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
_getElements() {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
293
|
+
const elements = FlattenedNodesObserver.getFlattenedNodes(this)
|
|
294
|
+
.filter(this._isActionNode)
|
|
295
|
+
.filter((element) => !element.hidden)
|
|
296
|
+
.sort((a, b) => (a.dataset.index ?? 0) - (b.dataset.index ?? 0)),
|
|
297
|
+
topPriorityAction = elements.reduce(
|
|
298
|
+
(top, element) => {
|
|
299
|
+
return parseInt(top.dataset.priority ?? 0, 10) >=
|
|
300
|
+
parseInt(element.dataset.priority ?? 0, 10)
|
|
301
|
+
? top
|
|
302
|
+
: element;
|
|
303
|
+
},
|
|
304
|
+
{ dataset: { priority: '-1000' } },
|
|
305
|
+
[]
|
|
306
|
+
);
|
|
307
|
+
|
|
308
|
+
return [
|
|
309
|
+
topPriorityAction,
|
|
310
|
+
...elements.filter((e) => e !== topPriorityAction),
|
|
311
|
+
];
|
|
297
312
|
}
|
|
298
313
|
/**
|
|
299
314
|
* Layout the actions available as buttons or menu items
|
package/package.json
CHANGED