app/assets/lookbook/js/components/nav-group.js in lookbook-0.6.1 vs app/assets/lookbook/js/components/nav-group.js in lookbook-0.7.0
- old
+ new
@@ -1,7 +1,5 @@
-import { getAlpineData } from "../lib/utils";
-
export default function navGroup() {
return {
hidden: false,
children: [],
get id() {
@@ -30,21 +28,20 @@
}
},
filter(text) {
this.hidden = true;
this.getChildren().forEach((child) => {
- const data = getAlpineData(child);
+ const data = Alpine.$data(child);
data.filter(text);
if (!data.hidden) {
this.hidden = false;
}
});
},
firstVisibleChild() {
return this.getChildren().find((child) => {
- return child._x_dataStack
- ? child._x_dataStack[0].hidden === false
- : false;
+ const data = Alpine.$data(child);
+ return data.hidden === false;
});
},
};
}