LT-318 Disable Case Progress, Trial, HUD and Measurements panels if the study is not associated
This commit is contained in:
1 parent
24d3c1bd8a
commit
4dd9ee3f37
7 files changed
+37
-8
No files matched your search
@@ -14,10 +14,10 @@
|
||||
{{>studySeriesQuickSwitch (clone this side="middle" viewportIndex=0)}}
|
||||
{{/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}}
|
||||
</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}}
|
||||
</div>
|
||||
<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({
|
||||
'click #toggleHUD'(event) {
|
||||
const $this = $(event.currentTarget).find('#toggleHUD');
|
||||
const $this = $(event.currentTarget);
|
||||
|
||||
// Stop here if the tool is disabled
|
||||
if ($this.hasClass('disabled')) {
|
||||
@@ -156,7 +156,7 @@ Template.toolbarSection.events({
|
||||
Session.set('measurementTableHudOpen', !state);
|
||||
},
|
||||
'click #toggleTrial'(event) {
|
||||
const $this = $(event.currentTarget).find('#toggleHUD');
|
||||
const $this = $(event.currentTarget);
|
||||
|
||||
// Stop here if the tool is disabled
|
||||
if ($this.hasClass('disabled')) {
|
||||
@@ -172,14 +172,21 @@ Template.toolbarSection.onRendered(function() {
|
||||
const states = toolManager.getToolDefaultStates();
|
||||
const disabledToolButtons = states.disabledToolButtons;
|
||||
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) {
|
||||
for (var i = 0; i < allToolbarButtons.length; i++) {
|
||||
const toolbarButton = allToolbarButtons[i];
|
||||
$(toolbarButton).removeClass('disabled');
|
||||
|
||||
const index = disabledToolButtons.indexOf($(toolbarButton).attr('id'));
|
||||
if (index !== -1) {
|
||||
$(toolbarButton).addClass('disabled');
|
||||
$(toolbarButton).find('*').addClass('disabled');
|
||||
} else {
|
||||
$(toolbarButton).removeClass('disabled');
|
||||
$(toolbarButton).find('*').removeClass('disabled');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user