From bbcbc93510ed5e60600f07bbc44b853e7e4e7824 Mon Sep 17 00:00:00 2001 From: Erik Ziegler Date: Tue, 9 Aug 2016 21:21:02 +0200 Subject: [PATCH] Clean up Cornerstone enabledElements in thumbnails (LT-251) --- .../client/components/ohifViewer/ohifViewer.js | 2 -- .../client/components/ohifViewer/ohifViewer.styl | 3 +-- .../studyBrowser/imageThumbnail/imageThumbnail.js | 15 +++++++++++++-- .../studyBrowser/thumbnailEntry/thumbnailEntry.js | 2 ++ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/OHIFViewer/client/components/ohifViewer/ohifViewer.js b/OHIFViewer/client/components/ohifViewer/ohifViewer.js index bd5af0ac8..70f906dfd 100644 --- a/OHIFViewer/client/components/ohifViewer/ohifViewer.js +++ b/OHIFViewer/client/components/ohifViewer/ohifViewer.js @@ -1,8 +1,6 @@ const worklistContentId = 'worklistTab'; let lastContentId; -// Test - // Define the ViewerData global object // If there is currently any Session data for this object, // use this to repopulate the variable diff --git a/OHIFViewer/client/components/ohifViewer/ohifViewer.styl b/OHIFViewer/client/components/ohifViewer/ohifViewer.styl index d1453ca87..55b773f4c 100644 --- a/OHIFViewer/client/components/ohifViewer/ohifViewer.styl +++ b/OHIFViewer/client/components/ohifViewer/ohifViewer.styl @@ -70,5 +70,4 @@ img.logoImage .viewerContainer .loadingTextDiv color: $textSecondaryColor - font-size: 30px - font-weight: 200 \ No newline at end of file + font-size: 30px \ No newline at end of file diff --git a/Packages/viewerbase/client/components/studyBrowser/imageThumbnail/imageThumbnail.js b/Packages/viewerbase/client/components/studyBrowser/imageThumbnail/imageThumbnail.js index bdf72869e..a8faba2e4 100644 --- a/Packages/viewerbase/client/components/studyBrowser/imageThumbnail/imageThumbnail.js +++ b/Packages/viewerbase/client/components/studyBrowser/imageThumbnail/imageThumbnail.js @@ -12,13 +12,13 @@ Template.imageThumbnail.onRendered(() => { // Disable cornerstone for thumbnail element and remove its canvas cornerstone.disable(element); - // Enable cornerstone for thumbnail element angain creating a new canvas + // Enable cornerstone for thumbnail element again creating a new canvas cornerstone.enable(element); // Get the image ID const stack = instance.data.thumbnail.stack; - const imageInstance = stack.images[0]; const thumbnailIndex = instance.data.thumbnail.thumbnailIndex; + const imageInstance = stack.images[0]; const imageId = getImageId(imageInstance); // Activate the loading state @@ -59,6 +59,17 @@ Template.imageThumbnail.onRendered(() => { }); }); +Template.imageThumbnail.onDestroyed(() => { + const instance = Template.instance(); + + // Declare DOM and jQuery objects + const $parent = instance.$('.imageThumbnail'); + const $element = $parent.find('.imageThumbnailCanvas'); + const element = $element.get(0); + + cornerstone.disable(element); +}); + Template.imageThumbnail.helpers({ // Executed every time the image loading progress is changed percentComplete() { diff --git a/Packages/viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.js b/Packages/viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.js index 676ccb7e3..b2ee60f72 100644 --- a/Packages/viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.js +++ b/Packages/viewerbase/client/components/studyBrowser/thumbnailEntry/thumbnailEntry.js @@ -211,9 +211,11 @@ Template.thumbnailEntry.events({ const data = instance.data.thumbnail.stack; instance.isDragAndDrop && thumbnailDragStartHandler(event, data); }, + 'touchmove .thumbnailEntry'(event, instance) { instance.isDragAndDrop && thumbnailDragHandler(event); }, + 'touchend .thumbnailEntry'(event, instance) { const data = instance.data.thumbnail.stack; instance.isDragAndDrop && thumbnailDragEndHandler(event, data);