Skip to content

Commit

Permalink
Merge pull request #696 from drgrice1/knowls-await-load
Browse files Browse the repository at this point in the history
Make knowls wait until the page css has loaded before initializing.
  • Loading branch information
pstaabp authored Jul 13, 2022
2 parents d3288f9 + e7f73e1 commit 3ef38fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions htdocs/js/apps/Knowls/knowl.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
};

const initializeKnowl = (knowl) => {
if (getComputedStyle(knowl)?.display === '') {
setTimeout(() => initializeKnowl(knowl), 100);
return;
}

knowl.dataset.bsToggle = 'collapse';
if (!knowl.knowlContainer) {
knowl.knowlContainer = document.createElement('div');
Expand Down

0 comments on commit 3ef38fe

Please sign in to comment.