mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
mermaid: rerender graph if search term is present and variant is switched #460
This commit is contained in:
parent
973e95af07
commit
8f4d9f4930
1 changed files with 10 additions and 0 deletions
|
@ -216,11 +216,21 @@ function initMermaid( update, attrs ) {
|
||||||
attrs = attrs || {
|
attrs = attrs || {
|
||||||
'theme': variants.getColorValue( 'MERMAID-theme' ),
|
'theme': variants.getColorValue( 'MERMAID-theme' ),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var search;
|
||||||
|
if( update ){
|
||||||
|
search = sessionStorage.getItem( baseUriFull+'search-value' );
|
||||||
|
unmark();
|
||||||
|
}
|
||||||
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();
|
mermaid.init();
|
||||||
$(".mermaid svg").svgPanZoom({});
|
$(".mermaid svg").svgPanZoom({});
|
||||||
}
|
}
|
||||||
|
if( update && search && search.length ){
|
||||||
|
sessionStorage.setItem( baseUriFull+'search-value', search );
|
||||||
|
mark();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initSwagger( update, attrs ){
|
function initSwagger( update, attrs ){
|
||||||
|
|
Loading…
Reference in a new issue