LT-318 Disable Case Progress, Trial, HUD and Measurements panels if the study is not associated
This commit is contained in:
parent
24d3c1bd8a
commit
4dd9ee3f37
@ -14,10 +14,10 @@
|
|||||||
{{>studySeriesQuickSwitch (clone this side="middle" viewportIndex=0)}}
|
{{>studySeriesQuickSwitch (clone this side="middle" viewportIndex=0)}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="toolbarSectionEntry pull-right rm-l-1 p-x-1">
|
<div id="toolbarSectionEntry" class="toolbarSectionEntry pull-right rm-l-1 p-x-1">
|
||||||
{{>caseProgress}}
|
{{>caseProgress}}
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-right m-t-1 rm-x-1">
|
<div id="toggleMeasurements" class="pull-right m-t-1 rm-x-1">
|
||||||
{{>roundedButtonGroup rightSidebarToggleButtonData}}
|
{{>roundedButtonGroup rightSidebarToggleButtonData}}
|
||||||
</div>
|
</div>
|
||||||
<div id="toggleHUD" class="toolbarSectionButton pull-right rp-x-1 m-t-1 rm-r-3 {{#if session 'measurementTableHudOpen'}}active{{/if}}">
|
<div id="toggleHUD" class="toolbarSectionButton pull-right rp-x-1 m-t-1 rm-r-3 {{#if session 'measurementTableHudOpen'}}active{{/if}}">
|
||||||
|
|||||||
@ -145,7 +145,7 @@ Template.toolbarSection.helpers({
|
|||||||
|
|
||||||
Template.toolbarSection.events({
|
Template.toolbarSection.events({
|
||||||
'click #toggleHUD'(event) {
|
'click #toggleHUD'(event) {
|
||||||
const $this = $(event.currentTarget).find('#toggleHUD');
|
const $this = $(event.currentTarget);
|
||||||
|
|
||||||
// Stop here if the tool is disabled
|
// Stop here if the tool is disabled
|
||||||
if ($this.hasClass('disabled')) {
|
if ($this.hasClass('disabled')) {
|
||||||
@ -156,7 +156,7 @@ Template.toolbarSection.events({
|
|||||||
Session.set('measurementTableHudOpen', !state);
|
Session.set('measurementTableHudOpen', !state);
|
||||||
},
|
},
|
||||||
'click #toggleTrial'(event) {
|
'click #toggleTrial'(event) {
|
||||||
const $this = $(event.currentTarget).find('#toggleHUD');
|
const $this = $(event.currentTarget);
|
||||||
|
|
||||||
// Stop here if the tool is disabled
|
// Stop here if the tool is disabled
|
||||||
if ($this.hasClass('disabled')) {
|
if ($this.hasClass('disabled')) {
|
||||||
@ -172,14 +172,21 @@ Template.toolbarSection.onRendered(function() {
|
|||||||
const states = toolManager.getToolDefaultStates();
|
const states = toolManager.getToolDefaultStates();
|
||||||
const disabledToolButtons = states.disabledToolButtons;
|
const disabledToolButtons = states.disabledToolButtons;
|
||||||
const allToolbarButtons = $('.toolbarSection').find('.toolbarSectionButton');
|
const allToolbarButtons = $('.toolbarSection').find('.toolbarSectionButton');
|
||||||
|
|
||||||
|
// Additional toolbar buttons whose classes are not toolbarSectionButton
|
||||||
|
allToolbarButtons.push($('#toolbarSectionEntry')[0]);
|
||||||
|
allToolbarButtons.push($('#toggleMeasurements')[0]);
|
||||||
|
|
||||||
if (disabledToolButtons && disabledToolButtons.length > 0) {
|
if (disabledToolButtons && disabledToolButtons.length > 0) {
|
||||||
for (var i = 0; i < allToolbarButtons.length; i++) {
|
for (var i = 0; i < allToolbarButtons.length; i++) {
|
||||||
const toolbarButton = allToolbarButtons[i];
|
const toolbarButton = allToolbarButtons[i];
|
||||||
$(toolbarButton).removeClass('disabled');
|
|
||||||
|
|
||||||
const index = disabledToolButtons.indexOf($(toolbarButton).attr('id'));
|
const index = disabledToolButtons.indexOf($(toolbarButton).attr('id'));
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
$(toolbarButton).addClass('disabled');
|
$(toolbarButton).addClass('disabled');
|
||||||
|
$(toolbarButton).find('*').addClass('disabled');
|
||||||
|
} else {
|
||||||
|
$(toolbarButton).removeClass('disabled');
|
||||||
|
$(toolbarButton).find('*').removeClass('disabled');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,12 @@ Template.roundedButtonGroup.events({
|
|||||||
'click [data-value]'(event, instance) {
|
'click [data-value]'(event, instance) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
const $target = $(event.currentTarget);
|
const $target = $(event.currentTarget);
|
||||||
|
|
||||||
|
// Stop here if the tool is disabled
|
||||||
|
if ($target.hasClass('disabled')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const nullValue = $target.hasClass('active') && instance.data.toggleable;
|
const nullValue = $target.hasClass('active') && instance.data.toggleable;
|
||||||
const value = nullValue ? null : $target.attr('data-value');
|
const value = nullValue ? null : $target.attr('data-value');
|
||||||
instance.setValue(value);
|
instance.setValue(value);
|
||||||
|
|||||||
@ -12,6 +12,10 @@ $height = 25px
|
|||||||
text-decoration: none
|
text-decoration: none
|
||||||
text-align: center
|
text-align: center
|
||||||
|
|
||||||
|
&.disabled
|
||||||
|
opacity: 0.5
|
||||||
|
cursor: not-allowed
|
||||||
|
|
||||||
.roundedButton
|
.roundedButton
|
||||||
align-items: center
|
align-items: center
|
||||||
theme('background-color', '$uiGrayDark')
|
theme('background-color', '$uiGrayDark')
|
||||||
|
|||||||
@ -48,7 +48,8 @@ OHIF.lesiontracker.toggleLesionTrackerToolsButtons = (isEnabled) => {
|
|||||||
if (isEnabled) {
|
if (isEnabled) {
|
||||||
toolStates.disabledToolButtons = [];
|
toolStates.disabledToolButtons = [];
|
||||||
} else {
|
} else {
|
||||||
toolStates.disabledToolButtons = [ 'bidirectional', 'nonTarget', 'crTool', 'unTool', 'exTool', 'toggleHUD', 'toggleTrial', 'toolbarSectionEntry' ];
|
toolStates.disabledToolButtons = [ 'bidirectional', 'nonTarget', 'crTool', 'unTool', 'exTool',
|
||||||
|
'toggleHUD', 'toggleTrial', 'toolbarSectionEntry', 'toggleMeasurements' ];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reload the updated previous or default states
|
// Reload the updated previous or default states
|
||||||
|
|||||||
@ -122,7 +122,14 @@ Template.caseProgress.helpers({
|
|||||||
});
|
});
|
||||||
|
|
||||||
Template.caseProgress.events({
|
Template.caseProgress.events({
|
||||||
'click .js-finish-case'() {
|
'click .js-finish-case'(event) {
|
||||||
|
const $this = $(event.currentTarget);
|
||||||
|
|
||||||
|
// Stop here if the tool is disabled
|
||||||
|
if ($this.hasClass('disabled')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const instance = Template.instance();
|
const instance = Template.instance();
|
||||||
switchToTab('studylistTab');
|
switchToTab('studylistTab');
|
||||||
instance.data.measurementApi.storeMeasurements();
|
instance.data.measurementApi.storeMeasurements();
|
||||||
|
|||||||
@ -30,3 +30,7 @@
|
|||||||
margin-top: 6px
|
margin-top: 6px
|
||||||
text-align: center
|
text-align: center
|
||||||
width: 126px
|
width: 126px
|
||||||
|
|
||||||
|
&.disabled
|
||||||
|
opacity: 0.5
|
||||||
|
cursor: not-allowed
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user