reload masonry when dom is updated

This commit is contained in:
2023-11-29 16:01:15 +01:00
parent ae2265df21
commit 2af9ff7d00

View File

@@ -64,7 +64,8 @@ export default {
counterClass: {
counter: true //hack to pass class 'counter' in i18n-t
},
dashboardItems: []
dashboardItems: [],
masonry: null,
}
},
computed: {
@@ -75,7 +76,7 @@ export default {
},
mounted() {
const elem = document.querySelector('#dashboards');
const masonry = new Masonry(elem, {});
this.masonry = new Masonry(elem, {});
//Fetch the dashboard items configured for user. Currently response is still hardcoded
makeFetch('GET', '/api/1.0/main/dashboard-config-item.json')
.then((response) => {
@@ -84,8 +85,13 @@ export default {
})
.catch((error) => {
throw error
})
}
});
},
updated() {
this.masonry.layout();
}
}
</script>