Skip to content

Commit

Permalink
Rerender diagram after overview navigation
Browse files Browse the repository at this point in the history
This resolves an issue where the diagram is rendered as the user navigates in the overview, then selects a slide, and finds the text is not visible.

The diagram was being rendered while the slide was tiny in the overview, and this meant the sizes were screwed up. By destroying and showing the diagram again when the overview is hidden (hence the slide is the proper size), the diagram renders properly.
  • Loading branch information
mrmanc committed Nov 2, 2022
1 parent 099f820 commit f60db09
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assets/js/mermaid/reveal-js-mermaid-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,10 @@
}
});

Reveal.addEventListener('overviewhidden', function (event) {
if (event.currentSlide) {
destroyDiagram(event.currentSlide);
showDiagram(event.currentSlide);
}
});
}());

0 comments on commit f60db09

Please sign in to comment.