Allowing series to be loaded by a single click on sidebar

This commit is contained in:
Bruno Alves de Faria 2018-02-22 15:40:02 -03:00
parent 1a83379868
commit fdcaea9eb3
4 changed files with 18 additions and 2 deletions

View File

@ -142,6 +142,11 @@ export const UISettings = new SimpleSchema({
label: 'Left sidebar open by default?',
defaultValue: false
},
leftSidebarDragAndDrop: {
type: Boolean,
label: 'Left sidebar allows thumbnail drag and drop. If false, images will be loaded on single click.',
defaultValue: true
},
displaySetNavigationLoopOverSeries: {
type: Boolean,
label: 'The UP/DOWN display set navigation buttons will start over when reach the last display set in viewport?',

View File

@ -3,6 +3,7 @@ import { Template } from 'meteor/templating';
import { Tracker } from 'meteor/tracker';
import { Session } from 'meteor/session';
import { OHIF } from 'meteor/ohif:core';
import { cornerstone } from 'meteor/ohif:cornerstone';
Template.imageThumbnail.onCreated(() => {
const instance = Template.instance();

View File

@ -31,6 +31,9 @@
height: 100%
overflow: hidden
img
-webkit-user-drag: none
.thumbnailLoadingIndicator
display: none
pointer-events: none

View File

@ -9,7 +9,8 @@ Template.thumbnailEntry.onCreated(() => {
const instance = Template.instance();
// Check if the thumbnails will be draggable or clickable
instance.isDragAndDrop = _.isUndefined(instance.data.viewportIndex);
const isIndexUndefined = _.isUndefined(instance.data.viewportIndex);
instance.isDragAndDrop = isIndexUndefined && OHIF.uiSettings.leftSidebarDragAndDrop !== false;
});
Template.thumbnailEntry.events({
@ -44,8 +45,14 @@ Template.thumbnailEntry.events({
// Get the thumbnail stack data
const data = instance.data.thumbnail.stack;
// Get the viewport index
let { viewportIndex } = instance.data;
if (_.isUndefined(viewportIndex)) {
viewportIndex = Session.get('activeViewport') || 0;
}
// Rerender the viewport using the clicked thumbnail data
OHIF.viewerbase.layoutManager.rerenderViewportWithNewDisplaySet(instance.data.viewportIndex, data);
OHIF.viewerbase.layoutManager.rerenderViewportWithNewDisplaySet(viewportIndex, data);
},
// Event handlers for double click