Fixing QuickSwitch issue with Additional Timepoints

This commit is contained in:
Bruno Alves de Faria 2017-10-03 15:35:08 -03:00
parent 4c8190e0cc
commit 870ed66013
2 changed files with 8 additions and 1 deletions

View File

@ -25,7 +25,7 @@
</div>
<hr>
{{/each}}
{{#if and this.currentStudy (not showAdditionalTimepoints)}}
{{#if and this.currentStudy (not showAdditionalTimepoints) hasAdditionalTimepoints}}
<div class="studyModality additional">
Show additional timepoints
</div>

View File

@ -140,6 +140,13 @@ Template.studyTimepointBrowser.helpers({
return Template.instance().showAdditionalTimepoints.get();
},
hasAdditionalTimepoints() {
const instance = Template.instance();
const { timepointApi } = instance.data;
const allTimepoints = timepointApi && timepointApi.all();
return allTimepoints && allTimepoints.length > 1;
},
// Get the timepoints to be listed
timepoints() {
const instance = Template.instance();