Skip to content

Commit

Permalink
Codacy fix SyncControl
Browse files Browse the repository at this point in the history
  • Loading branch information
chrizzor committed Jul 15, 2024
1 parent fb3a4b9 commit 752fff6
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions Resources/Public/JavaScript/PageView/SyncControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

class SyncViewsControl extends ol.control.Control {
/**
* @param {Object} [opt_options] Control options.
* @param {object} [optOptions] Control options.
*/
constructor(opt_options) {
const options = opt_options || {};
constructor(optOptions) {
const options = optOptions || {};

var button = document.createElement('button');
button.innerHTML = 'SYNC';
Expand All @@ -27,30 +27,23 @@ class SyncViewsControl extends ol.control.Control {
element.appendChild(buttonUnsync);

super({
element: element,
element,
target: options.target,
});

var viewerContext = options.dlfViewerObject;

var syncViews = function() {
viewerContext.syncControl.setSync();
};

var unsyncViews = function() {
viewerContext.syncControl.unsetSync();
};

button.addEventListener('click', syncViews, false);
buttonUnsync.addEventListener('click', unsyncViews, false);
button.addEventListener('click', viewerContext.syncControl.setSync(), false);
buttonUnsync.addEventListener('click', viewerContext.syncControl.unsetSync(), false);
}

}

/**
* Encapsulates especially the score behavior
* @class
* @param dlfViewer
* @param sync
* @param {object} dlfViewer
* @param {boolean} sync
*/
const dlfViewerSyncControl = function(dlfViewer, sync = false) {
this.dlfViewer = dlfViewer;
Expand Down

0 comments on commit 752fff6

Please sign in to comment.