Updates to improve reactivity, session storage, logging

This commit is contained in:
Erik Ziegler committed 2015-10-30 12:25:08 +01:00
1 parent 9fb5cc2953
commit a10f149b4b
37 files changed
+370 -288

No files matched your search

@@ -3,12 +3,22 @@ TabsTimepoints = new Meteor.Collection(null);
Template.lesionTable.helpers({
'measurement': function() {
<<<<<<< HEAD
var contentId = Session.get("activeContentId");
return Measurements.find({contentId: contentId});
},
'tabTimepoints': function() {
var contentId = Session.get("activeContentId");
return TabsTimepoints.find({contentId: contentId});
=======
var contentId = this.contentId;
console.log(Measurements.find({contentId: contentId}));
return Measurements.find({contentId: contentId});
},
'timepointNames': function() {
var contentId = this.contentId;
return Template.instance().timepointNamesDictionary.get(contentId);
>>>>>>> Updates to improve reactivity, session storage, logging
},
'lesionData': function() {
var array = [];
@@ -21,19 +31,16 @@ Template.lesionTable.helpers({
});
Template.lesionTable.onRendered(function() {
var contentId = this.data.contentId;
var viewportColumns = ViewerData[contentId].viewportColumns;
var viewportRows = ViewerData[contentId].viewportRows;
var cols = Template.instance().data.viewportColumns.curValue;
var rows = Template.instance().data.viewportRows.curValue;
var totalViewports = cols * rows;
var contentId = Session.get('activeContentId');
var timepointsArray = [];
var totalViewports = viewportColumns * viewportRows;
for(var i=0; i< totalViewports; i++) {
var timepointID = contentId.toString()+ i.toString();
var timepointID = contentId.toString() + i.toString();
var timepointName = "Baseline";
if(i > 0) {
if (i > 0) {
timepointName = "Follow Up "+i;
}
var timepointObject = {timepointID: timepointID, timepointName: timepointName};
@@ -43,7 +50,7 @@ Template.lesionTable.onRendered(function() {
// Prevent duplicate data when onRendered is called
var tabTimepoint = TabsTimepoints.find({contentId: contentId}).fetch();
if (tabTimepoint != undefined && tabTimepoint.length > 0) {
if (tabTimepoint !== undefined && tabTimepoint.length > 0) {
// Update timepoints
TabsTimepoints.update(
{ contentId: contentId},