From 5019f539eef7be82ddafb422eae6773a65546582 Mon Sep 17 00:00:00 2001 From: James Petts Date: Mon, 12 Nov 2018 11:18:48 +0000 Subject: [PATCH] Fix keyscroll. --- .../client/lib/switchToImageRelative.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Packages/ohif-viewerbase/client/lib/switchToImageRelative.js b/Packages/ohif-viewerbase/client/lib/switchToImageRelative.js index 92e4845cb..95b858013 100644 --- a/Packages/ohif-viewerbase/client/lib/switchToImageRelative.js +++ b/Packages/ohif-viewerbase/client/lib/switchToImageRelative.js @@ -1,15 +1,18 @@ import { viewportUtils } from './viewportUtils'; +import { cornerstoneTools } from 'meteor/ohif:cornerstone'; + +const scroll = cornerstoneTools.import('util/scroll'); /** - * This function switches to an image given an element and + * This function switches to an image given an element and * the relative distance from the current image in the stack - * + * * e.g. switchToImageRelative(element, -1) to switch to currentImageIdIndex - 1 - * + * * @param element * @param {number} [distanceFromCurrentIndex] The image index in the stack to switch to. */ export function switchToImageRelative(distanceFromCurrentIndex) { var element = viewportUtils.getActiveViewportElement(); - cornerstoneTools.scroll(element, distanceFromCurrentIndex); + scroll(element, distanceFromCurrentIndex); }