mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
mermaid: variant generator diagram does not respond to events #607
This commit is contained in:
parent
b2e841caaa
commit
3dada8b058
1 changed files with 3 additions and 1 deletions
|
@ -276,7 +276,8 @@ function initMermaid( update, attrs ) {
|
||||||
}
|
}
|
||||||
var is_initialized = ( update ? update_func( attrs ) : init_func( attrs ) );
|
var is_initialized = ( update ? update_func( attrs ) : init_func( attrs ) );
|
||||||
if( is_initialized ){
|
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
|
// zoom for Mermaid
|
||||||
// https://github.com/mermaid-js/mermaid/issues/1860#issuecomment-1345440607
|
// https://github.com/mermaid-js/mermaid/issues/1860#issuecomment-1345440607
|
||||||
var svgs = d3.selectAll( '.mermaid.zoom svg' );
|
var svgs = d3.selectAll( '.mermaid.zoom svg' );
|
||||||
|
@ -1345,6 +1346,7 @@ function useMermaid( config ){
|
||||||
// We don't support Mermaid for IE11 anyways, so bail out early
|
// We don't support Mermaid for IE11 anyways, so bail out early
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
window.relearn.mermaidConfig = config;
|
||||||
if (typeof mermaid != 'undefined' && typeof mermaid.mermaidAPI != 'undefined') {
|
if (typeof mermaid != 'undefined' && typeof mermaid.mermaidAPI != 'undefined') {
|
||||||
mermaid.initialize( Object.assign( { "securityLevel": "antiscript", "startOnLoad": false }, config ) );
|
mermaid.initialize( Object.assign( { "securityLevel": "antiscript", "startOnLoad": false }, config ) );
|
||||||
if( config.theme && variants ){
|
if( config.theme && variants ){
|
||||||
|
|
Loading…
Reference in a new issue