diff --git a/static/js/dicomViewer.js b/static/js/dicomViewer.js index 537980cc..c24c6c26 100644 --- a/static/js/dicomViewer.js +++ b/static/js/dicomViewer.js @@ -599,6 +599,7 @@ function selectThumbClick(evt) { export function registerPrimaryDicomInterface() { // Set mousetools based upon the selected options + let element = document.getElementsByClassName("single-dicom-viewer")[0]; let selections = $("#primary-mouse-binding select"); selections.each((i, option) => { cornerstoneTools.setToolActiveForElement(element, option.value, { @@ -611,6 +612,7 @@ export function registerAltDicomInterface(e) { // Called when control is pressed // Set mousetools based upon the selected options + let element = document.getElementsByClassName("single-dicom-viewer")[0]; let selections = $("#secondary-mouse-binding select"); selections.each((i, option) => { cornerstoneTools.setToolActiveForElement(element, option.value, { @@ -628,6 +630,7 @@ function changeMouseBinding(e, db) { // Directly activate primary tools (secondary will be activated when modifier // key is pressed if (mode == "0") { + let element = document.getElementsByClassName("single-dicom-viewer")[0]; cornerstoneTools.setToolActiveForElement(element, tool, { mouseButtonMask: parseInt(button) }); }