Skip to content

Commit

Permalink
mermaid: variant generator diagram does not respond to events #607
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Aug 7, 2023
1 parent b2e841c commit 3dada8b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion static/js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ function initMermaid( update, attrs ) {
}
var is_initialized = ( update ? update_func( attrs ) : init_func( attrs ) );
if( is_initialized ){
mermaid.init( {theme: attrs.theme} );
mermaid.initialize( Object.assign( { "securityLevel": "antiscript", "startOnLoad": false }, window.relearn.mermaidConfig, { theme: attrs.theme } ) );
mermaid.run();
// zoom for Mermaid
// https://github.com/mermaid-js/mermaid/issues/1860#issuecomment-1345440607
var svgs = d3.selectAll( '.mermaid.zoom svg' );
Expand Down Expand Up @@ -1345,6 +1346,7 @@ function useMermaid( config ){
// We don't support Mermaid for IE11 anyways, so bail out early
return;
}
window.relearn.mermaidConfig = config;
if (typeof mermaid != 'undefined' && typeof mermaid.mermaidAPI != 'undefined') {
mermaid.initialize( Object.assign( { "securityLevel": "antiscript", "startOnLoad": false }, config ) );
if( config.theme && variants ){
Expand Down

0 comments on commit 3dada8b

Please sign in to comment.