collapsible.js: Fix flickering

This commit is contained in:
Johannes Meyer 2021-05-12 09:06:26 +02:00
parent 89fdccb858
commit 54720a1fc1

View File

@ -79,11 +79,12 @@
} }
}); });
setTimeout(function () { // Elements are all collapsed in a row now, after height calculations are done.
for (var i = 0; i < toCollapse.length; i++) { // This avoids reflows since instantly collapsing an element will cause one if
_this.collapse(toCollapse[i][0], toCollapse[i][1]); // the height of the next element is being calculated.
} for (var i = 0; i < toCollapse.length; i++) {
}, 0); _this.collapse(toCollapse[i][0], toCollapse[i][1]);
}
}; };
/** /**