reload masonry when dom is updated

This commit is contained in:
Julien Fastré 2023-11-29 16:01:15 +01:00
parent ae2265df21
commit 2af9ff7d00
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

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>