Clean up Cornerstone enabledElements in thumbnails (LT-251)
This commit is contained in:
parent
bd7c847443
commit
bbcbc93510
@ -1,8 +1,6 @@
|
|||||||
const worklistContentId = 'worklistTab';
|
const worklistContentId = 'worklistTab';
|
||||||
let lastContentId;
|
let lastContentId;
|
||||||
|
|
||||||
// Test
|
|
||||||
|
|
||||||
// Define the ViewerData global object
|
// Define the ViewerData global object
|
||||||
// If there is currently any Session data for this object,
|
// If there is currently any Session data for this object,
|
||||||
// use this to repopulate the variable
|
// use this to repopulate the variable
|
||||||
|
|||||||
@ -70,5 +70,4 @@ img.logoImage
|
|||||||
.viewerContainer
|
.viewerContainer
|
||||||
.loadingTextDiv
|
.loadingTextDiv
|
||||||
color: $textSecondaryColor
|
color: $textSecondaryColor
|
||||||
font-size: 30px
|
font-size: 30px
|
||||||
font-weight: 200
|
|
||||||
@ -12,13 +12,13 @@ Template.imageThumbnail.onRendered(() => {
|
|||||||
// Disable cornerstone for thumbnail element and remove its canvas
|
// Disable cornerstone for thumbnail element and remove its canvas
|
||||||
cornerstone.disable(element);
|
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);
|
cornerstone.enable(element);
|
||||||
|
|
||||||
// Get the image ID
|
// Get the image ID
|
||||||
const stack = instance.data.thumbnail.stack;
|
const stack = instance.data.thumbnail.stack;
|
||||||
const imageInstance = stack.images[0];
|
|
||||||
const thumbnailIndex = instance.data.thumbnail.thumbnailIndex;
|
const thumbnailIndex = instance.data.thumbnail.thumbnailIndex;
|
||||||
|
const imageInstance = stack.images[0];
|
||||||
const imageId = getImageId(imageInstance);
|
const imageId = getImageId(imageInstance);
|
||||||
|
|
||||||
// Activate the loading state
|
// 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({
|
Template.imageThumbnail.helpers({
|
||||||
// Executed every time the image loading progress is changed
|
// Executed every time the image loading progress is changed
|
||||||
percentComplete() {
|
percentComplete() {
|
||||||
|
|||||||
@ -211,9 +211,11 @@ Template.thumbnailEntry.events({
|
|||||||
const data = instance.data.thumbnail.stack;
|
const data = instance.data.thumbnail.stack;
|
||||||
instance.isDragAndDrop && thumbnailDragStartHandler(event, data);
|
instance.isDragAndDrop && thumbnailDragStartHandler(event, data);
|
||||||
},
|
},
|
||||||
|
|
||||||
'touchmove .thumbnailEntry'(event, instance) {
|
'touchmove .thumbnailEntry'(event, instance) {
|
||||||
instance.isDragAndDrop && thumbnailDragHandler(event);
|
instance.isDragAndDrop && thumbnailDragHandler(event);
|
||||||
},
|
},
|
||||||
|
|
||||||
'touchend .thumbnailEntry'(event, instance) {
|
'touchend .thumbnailEntry'(event, instance) {
|
||||||
const data = instance.data.thumbnail.stack;
|
const data = instance.data.thumbnail.stack;
|
||||||
instance.isDragAndDrop && thumbnailDragEndHandler(event, data);
|
instance.isDragAndDrop && thumbnailDragEndHandler(event, data);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user