Skip to content

Commit f60db09

Browse files
committed
Rerender diagram after overview navigation
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.
1 parent 099f820 commit f60db09

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

assets/js/mermaid/reveal-js-mermaid-plugin.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,10 @@
9090
}
9191
});
9292

93+
Reveal.addEventListener('overviewhidden', function (event) {
94+
if (event.currentSlide) {
95+
destroyDiagram(event.currentSlide);
96+
showDiagram(event.currentSlide);
97+
}
98+
});
9399
}());

0 commit comments

Comments
 (0)