From f6eb23782e80bc90046a67fc2e087748b60bbe36 Mon Sep 17 00:00:00 2001 From: Christopher Timm Date: Fri, 19 Jul 2024 11:29:32 +0200 Subject: [PATCH] Add center so that verovio can be rendered. Fix the error with the sync buttons --- Resources/Public/JavaScript/PageView/ScoreControl.js | 1 + Resources/Public/JavaScript/PageView/SyncControl.js | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Resources/Public/JavaScript/PageView/ScoreControl.js b/Resources/Public/JavaScript/PageView/ScoreControl.js index 68423fe2a5..1cf6382f44 100644 --- a/Resources/Public/JavaScript/PageView/ScoreControl.js +++ b/Resources/Public/JavaScript/PageView/ScoreControl.js @@ -289,6 +289,7 @@ dlfViewerScoreControl.prototype.loadScoreData = function (scoreData, tk) { view: new ol.View({ projection: proj, //Center: [0, 0], center: ol.extent.getCenter(extent), + center: [0, 0], extent: extent, zoom: 1, minZoom: 1, diff --git a/Resources/Public/JavaScript/PageView/SyncControl.js b/Resources/Public/JavaScript/PageView/SyncControl.js index 2729015ec2..cb15e799be 100644 --- a/Resources/Public/JavaScript/PageView/SyncControl.js +++ b/Resources/Public/JavaScript/PageView/SyncControl.js @@ -33,8 +33,16 @@ class SyncViewsControl extends ol.control.Control { var viewerContext = options.dlfViewerObject; - button.addEventListener('click', viewerContext.syncControl.setSync(), false); - buttonUnsync.addEventListener('click', viewerContext.syncControl.unsetSync(), false); + var syncViews = function(e) { + viewerContext.syncControl.setSync(); + }; + + var unsyncViews = function(e) { + viewerContext.syncControl.unsetSync(); + }; + + button.addEventListener('click', syncViews, false); + buttonUnsync.addEventListener('click', unsyncViews, false); } }