Fixing delete lesion tool
This commit is contained in:
1 parent
5330ba5982
commit
5af752a122
3 files changed
+56
-35
No files matched your search
+18
-8
@@ -376,17 +376,20 @@ const loadDisplaySetIntoViewport = (data, templateData) => {
|
||||
// since this callback function is called multiple times (eg: when a tool is
|
||||
// enabled/disabled -> cornerstone[toolName].tool.enable)
|
||||
|
||||
// Reset the focus, even if we don't need to re-enable reference lines or prefetching
|
||||
const element = (eventData && eventData.element) || (event && event.currentTarget);
|
||||
if (!element) return;
|
||||
const $element = $(element);
|
||||
$element.focus();
|
||||
|
||||
// Stop here if we don't have eventData set
|
||||
if (!eventData) return;
|
||||
|
||||
// Check if the current active viewport in the Meteor Session
|
||||
// Is the same as the viewport in which the activation event was fired.
|
||||
// If it was, no changes are necessary, so stop here.
|
||||
const activeViewportIndex = Session.get('activeViewport');
|
||||
if (viewportIndex === activeViewportIndex) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Reset the focus, even if we don't need to re-enable reference lines or prefetching
|
||||
const element = eventData.element;
|
||||
$(element).focus();
|
||||
if (viewportIndex === activeViewportIndex) return;
|
||||
|
||||
OHIF.log.info('imageViewerViewport sendActivationTrigger');
|
||||
|
||||
@@ -397,12 +400,14 @@ const loadDisplaySetIntoViewport = (data, templateData) => {
|
||||
|
||||
// Need to overwrite the type set in the original event
|
||||
customEvent.type = 'OHIFActivateViewport';
|
||||
$(event.target).trigger(customEvent, eventData);
|
||||
$element.trigger(customEvent, eventData);
|
||||
};
|
||||
|
||||
// Attach the sendActivationTrigger function to all of the Cornerstone interaction events
|
||||
$element.off(allCornerstoneEvents, sendActivationTrigger);
|
||||
$element.on(allCornerstoneEvents, sendActivationTrigger);
|
||||
$element.off('mouseenter', sendActivationTrigger);
|
||||
$element.on('mouseenter', sendActivationTrigger);
|
||||
|
||||
OHIF.viewer.data.loadedSeriesData = layoutManager.viewportData;
|
||||
|
||||
@@ -522,6 +527,11 @@ Template.imageViewerViewport.onRendered(function() {
|
||||
// add the CSS 'active' class to highlight this viewport.
|
||||
const activeViewport = Session.get('activeViewport');
|
||||
|
||||
// Focus the viewport if it's the active one
|
||||
if (templateData.viewportIndex === activeViewport) {
|
||||
this.$element.focus();
|
||||
}
|
||||
|
||||
let { currentImageIdIndex } = templateData;
|
||||
const { viewport, studyInstanceUid, seriesInstanceUid, renderedCallback, displaySetInstanceUid } = templateData;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Session } from 'meteor/session';
|
||||
import { $ } from 'meteor/jquery';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { _ } from 'meteor/underscore';
|
||||
import { getFrameOfReferenceUID } from './getFrameOfReferenceUID';
|
||||
import { updateCrosshairsSynchronizer } from './updateCrosshairsSynchronizer';
|
||||
import { crosshairsSynchronizers } from './crosshairsSynchronizers';
|
||||
@@ -129,7 +129,7 @@ export const toolManager = {
|
||||
defaultMouseButtonTools = Meteor.settings && Meteor.settings.public && Meteor.settings.public.defaultMouseButtonTools;
|
||||
|
||||
// Override default tool if defined in settings
|
||||
defaultTool = (defaultMouseButtonTools && defaultMouseButtonTools.left) || "wwwc";
|
||||
defaultTool = (defaultMouseButtonTools && defaultMouseButtonTools.left) || 'wwwc';
|
||||
|
||||
this.configureTools();
|
||||
initialized = true;
|
||||
@@ -310,10 +310,10 @@ export const toolManager = {
|
||||
// Get the imageIds for this element
|
||||
const imageIds = toolData.data[0].imageIds;
|
||||
|
||||
const defaultMouseButtonToolNameMiddle = (defaultMouseButtonTools && defaultMouseButtonTools.middle) || "pan";
|
||||
const defaultMouseButtonToolNameMiddle = (defaultMouseButtonTools && defaultMouseButtonTools.middle) || 'pan';
|
||||
const defaultMouseButtonToolMiddle = cornerstoneTools[defaultMouseButtonToolNameMiddle];
|
||||
|
||||
const defaultMouseButtonToolNameRight = (defaultMouseButtonTools && defaultMouseButtonTools.right) || "zoom";
|
||||
const defaultMouseButtonToolNameRight = (defaultMouseButtonTools && defaultMouseButtonTools.right) || 'zoom';
|
||||
const defaultMouseButtonToolRight = cornerstoneTools[defaultMouseButtonToolNameRight];
|
||||
|
||||
// Deactivate all the middle mouse, right click, and scroll wheel tools
|
||||
@@ -483,9 +483,9 @@ export const toolManager = {
|
||||
|
||||
// Edge cases where the tool is not the same as the typeName
|
||||
if (toolType === 'simpleAngle') {
|
||||
toolInterfaceName = 'angle';
|
||||
toolInterfaceName = 'angle';
|
||||
} else if (toolType === 'arrowAnnotate') {
|
||||
toolInterfaceName = 'annotate';
|
||||
toolInterfaceName = 'annotate';
|
||||
}
|
||||
|
||||
if (touchDevice) {
|
||||
|
||||
Reference in new issue
Block a user