mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
mermaid: fix width for some graphs #655
This commit is contained in:
parent
45113efdf1
commit
bb77153860
1 changed files with 3 additions and 1 deletions
|
@ -322,7 +322,9 @@ function initMermaid( update, attrs ) {
|
||||||
svg.call( zoom );
|
svg.call( zoom );
|
||||||
var parent = this.parentElement;
|
var parent = this.parentElement;
|
||||||
// we need to copy the maxWidth, otherwise our reset button will not align in the upper right
|
// we need to copy the maxWidth, otherwise our reset button will not align in the upper right
|
||||||
parent.style.maxWidth = this.style.maxWidth;
|
parent.style.maxWidth = this.style.maxWidth || this.getAttribute( 'width' );
|
||||||
|
// if no unit is given for the width
|
||||||
|
parent.style.maxWidth = parent.style.maxWidth || this.getAttribute( 'width' ) + 'px';
|
||||||
parent.insertAdjacentHTML( 'beforeend', '<span class="svg-reset-button" title="' + window.T_Reset_view + '"><i class="fas fa-undo-alt"></i></span>' );
|
parent.insertAdjacentHTML( 'beforeend', '<span class="svg-reset-button" title="' + window.T_Reset_view + '"><i class="fas fa-undo-alt"></i></span>' );
|
||||||
parent.querySelector( '.svg-reset-button' ).addEventListener( 'click', function( event ){
|
parent.querySelector( '.svg-reset-button' ).addEventListener( 'click', function( event ){
|
||||||
inner.transition()
|
inner.transition()
|
||||||
|
|
Loading…
Reference in a new issue