LT-290 Disable Lesion Tracker tool buttons if the opened study is not associated

- Fix the bug with temp lesion when the study is not associated
This commit is contained in:
Evren Ozkan authored and Erik Ziegler committed 2016-11-15 08:24:30 +01:00
1 parent 7fa242d0aa
commit 5cbf08ea4f
5 files changed
+54 -9

No files matched your search

@@ -28,7 +28,7 @@
</div>
<div class="buttonLabel">HUD</div>
</div>
<div class="toolbarSectionButton pull-right rp-x-1 m-t-1 rm-r-1" data-toggle="modal" data-target="#optionsModal">
<div id="toggleTrial" class="toolbarSectionButton pull-right rp-x-1 m-t-1 rm-r-1">
<div class="svgContainer">
<svg>
<use xlink:href="/packages/ohif_viewerbase/assets/icons.svg#icon-trial-info"></use>
@@ -145,8 +145,25 @@ Template.toolbarSection.helpers({
Template.toolbarSection.events({
'click #toggleHUD'() {
const $this = $(event.currentTarget).find('#toggleHUD');
// Stop here if the tool is disabled
if ($this.hasClass('disabled')) {
return;
}
const state = Session.get('measurementTableHudOpen');
Session.set('measurementTableHudOpen', !state);
},
'click #toggleTrial'() {
const $this = $(event.currentTarget).find('#toggleHUD');
// Stop here if the tool is disabled
if ($this.hasClass('disabled')) {
return;
}
$('#optionsModal').modal();
}
});
@@ -154,15 +171,15 @@ Template.toolbarSection.onRendered(function() {
// Set disabled/enabled tool buttons that are set in toolManager
const states = toolManager.getToolDefaultStates();
const disabledToolButtons = states.disabledToolButtons;
const allToolbarButtons = $('#toolbar').find('button');
const allToolbarButtons = $('.toolbarSection').find('.toolbarSectionButton');
if (disabledToolButtons && disabledToolButtons.length > 0) {
for (var i = 0; i < allToolbarButtons.length; i++) {
const toolbarButton = allToolbarButtons[i];
$(toolbarButton).prop('disabled', false);
$(toolbarButton).removeClass('disabled');
const index = disabledToolButtons.indexOf($(toolbarButton).attr('id'));
if (index !== -1) {
$(toolbarButton).prop('disabled', true);
$(toolbarButton).addClass('disabled');
}
}
}