Commit 5969ba66 authored by Alain St-Denis's avatar Alain St-Denis
Browse files

Set the attributes option to true for the mutation observer

parent 20fe1b62
Pipeline #6402 passed with stages
in 14 minutes and 10 seconds
......@@ -83,6 +83,9 @@ const StreamElement = {
mounted() {
this.layoutAfterDOMChange()
this.layoutAfterTwitterOEmbeds()
if (!this.$store.state.stream.stream.single) {
this.$redrawVueMasonry()
}
},
updated() {
if (!this.$store.state.stream.stream.single) {
......@@ -93,14 +96,13 @@ const StreamElement = {
layoutAfterDOMChange() {
const post = document.getElementById(this.content.id)
if (post) {
const redraw = this.$redrawVueMasonry
// eslint-disable-next-line prefer-arrow-callback
const resizeObs = new MutationObserver(function () {
if (!this.$store.state.stream.stream.single) {
this.$redrawVueMasonry()
}
redraw()
})
// eslint-disable-next-line object-curly-newline
resizeObs.observe(post, {subtree: true, childList: true})
resizeObs.observe(post, {attributes: true, subtree: true, childList: true})
}
},
layoutAfterTwitterOEmbeds() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment