mermaid: show reset button after pan #807

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

View file

@ -323,7 +323,7 @@ function initMermaid( update, attrs ) {
var button = parent.querySelector( '.svg-reset-button' );
var zoom = d3.zoom().on( 'zoom', function( e ){
inner.attr( 'transform', e.transform );
if( e.transform.k == 1 ){
if( e.transform.k == 1 && e.transform.x == 0 && e.transform.y == 0 ){
button.classList.remove( 'zoomed' );
}
else{