generator: fix mermaid zoom after #795

This commit is contained in:
Sören Weber 2024-03-17 01:45:14 +01:00
parent f1c8e5c79d
commit bd94fe6b81
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D

View file

@ -218,10 +218,10 @@ function initMermaid( update, attrs ) {
var graph = serializeGraph( parse ); var graph = serializeGraph( parse );
var new_element = document.createElement( 'div' ); var new_element = document.createElement( 'div' );
for( var attr of element.attributes ){ Array.from( element.attributes ).forEach( function( attr ){
new_element.setAttribute( attr.name, attr.value ); new_element.setAttribute( attr.name, attr.value );
element.removeAttribute( attr.name ); element.removeAttribute( attr.name );
} });
new_element.classList.add( 'mermaid-container' ); new_element.classList.add( 'mermaid-container' );
new_element.classList.remove( 'mermaid' ); new_element.classList.remove( 'mermaid' );
element.classList.add( 'mermaid' ); element.classList.add( 'mermaid' );