mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-06 07:49:53 +00:00
reload masonry when dom is updated
This commit is contained in:
parent
ae2265df21
commit
2af9ff7d00
@ -64,7 +64,8 @@ export default {
|
|||||||
counterClass: {
|
counterClass: {
|
||||||
counter: true //hack to pass class 'counter' in i18n-t
|
counter: true //hack to pass class 'counter' in i18n-t
|
||||||
},
|
},
|
||||||
dashboardItems: []
|
dashboardItems: [],
|
||||||
|
masonry: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -75,7 +76,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const elem = document.querySelector('#dashboards');
|
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
|
//Fetch the dashboard items configured for user. Currently response is still hardcoded
|
||||||
makeFetch('GET', '/api/1.0/main/dashboard-config-item.json')
|
makeFetch('GET', '/api/1.0/main/dashboard-config-item.json')
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
@ -84,8 +85,13 @@ export default {
|
|||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
throw error
|
throw error
|
||||||
})
|
});
|
||||||
}
|
|
||||||
|
|
||||||
|
},
|
||||||
|
updated() {
|
||||||
|
this.masonry.layout();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user