Fixing flashButton wrong deactivation issue
This commit is contained in:
parent
68991df87c
commit
1983ee18a1
@ -8,7 +8,6 @@ Template.toolbarSectionButton.onCreated(() => {
|
||||
|
||||
instance.isActive = activeToolId => {
|
||||
OHIF.commands.last.dep.depend();
|
||||
const instance = Template.instance();
|
||||
const subTools = instance.data.subTools;
|
||||
const currentId = instance.data.id;
|
||||
const isCurrentTool = currentId === activeToolId;
|
||||
@ -52,7 +51,12 @@ Template.toolbarSectionButton.onCreated(() => {
|
||||
$element.addClass('active');
|
||||
setTimeout(() => {
|
||||
if ($element.hasClass('expandable') && $element.find('.toolbarSectionButton.active').length) return;
|
||||
|
||||
const activeToolId = Session.get('ToolManagerActiveTool');
|
||||
const isActive = instance.isActive(activeToolId);
|
||||
if (!isActive) {
|
||||
$element.removeClass('active');
|
||||
}
|
||||
}, 100);
|
||||
};
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import { $ } from 'meteor/jquery';
|
||||
import { _ } from 'meteor/underscore';
|
||||
// Local Modules
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { cornerstone, cornerstoneTools } from 'meteor/ohif:cornerstone';
|
||||
import { updateOrientationMarkers } from './updateOrientationMarkers';
|
||||
import { getInstanceClassDefaultViewport } from './instanceClassSpecificViewport';
|
||||
|
||||
@ -187,13 +188,15 @@ const toggleDialog = (element, closeAction) => {
|
||||
const $element = $(element);
|
||||
if ($element.is('dialog')) {
|
||||
if (element.hasAttribute('open')) {
|
||||
if (closeAction) closeAction();
|
||||
if (closeAction) {
|
||||
closeAction();
|
||||
}
|
||||
|
||||
element.close();
|
||||
} else {
|
||||
element.show();
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
const isClosed = $element.hasClass('dialog-open');
|
||||
$element.toggleClass('dialog-closed', isClosed);
|
||||
$element.toggleClass('dialog-open', !isClosed);
|
||||
@ -319,8 +322,7 @@ const stopActiveClip = () => {
|
||||
if ($(activeElement).find('canvas').length) {
|
||||
cornerstoneTools.stopClip(activeElement);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
const isStackScrollLinkingDisabled = () => {
|
||||
let linkableViewportsCount = 0;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user