Lazy loading measurements from lesions table
This commit is contained in:
1 parent
99c1fff3da
commit
89a96f02a0
7 files changed
+140
-142
No files matched your search
+2
-1
@@ -1,6 +1,7 @@
|
||||
<template name="measurementTableTimepointCell">
|
||||
{{#if hasDataAtThisTimepoint}}
|
||||
<div class="measurementTableTimepointCell noselect" tabindex="1">
|
||||
<div class="measurementTableTimepointCell noselect {{#if isLoading}}loading{{/if}}" tabindex="1">
|
||||
<i class="fa fa-spin fa-circle-o-notch fa-fw loading-spinner"></i>
|
||||
{{displayData}}
|
||||
</div>
|
||||
{{else}}
|
||||
|
||||
+12
-5
@@ -7,8 +7,7 @@ Template.measurementTableTimepointCell.helpers({
|
||||
// This simple function just checks whether or not timepoint data
|
||||
// exists for this Measurement at this Timepoint
|
||||
const instance = Template.instance();
|
||||
const rowItem = instance.data.rowItem;
|
||||
const timepointId = instance.data.timepointId;
|
||||
const { rowItem, timepointId } = instance.data;
|
||||
|
||||
if (timepointId) {
|
||||
const dataAtThisTimepoint = _.where(rowItem.entries, { timepointId });
|
||||
@@ -20,8 +19,7 @@ Template.measurementTableTimepointCell.helpers({
|
||||
|
||||
displayData() {
|
||||
const instance = Template.instance();
|
||||
const rowItem = instance.data.rowItem;
|
||||
const timepointId = instance.data.timepointId;
|
||||
const { rowItem, timepointId } = instance.data;
|
||||
|
||||
let data;
|
||||
if (timepointId) {
|
||||
@@ -45,8 +43,17 @@ Template.measurementTableTimepointCell.helpers({
|
||||
OHIF.log.warn('Something went wrong?');
|
||||
}
|
||||
|
||||
const displayFunction = tool.options.measurementTable.displayFunction;
|
||||
const { displayFunction } = tool.options.measurementTable;
|
||||
return displayFunction(data);
|
||||
},
|
||||
|
||||
isLoading() {
|
||||
const instance = Template.instance();
|
||||
const { rowItem, timepointId } = instance.data;
|
||||
const { entries } = rowItem;
|
||||
const measurementData = timepointId ? _.findWhere(entries, { timepointId }) : entries[0];
|
||||
const { studyInstanceUid } = measurementData;
|
||||
return OHIF.studies.loadingDict.get(studyInstanceUid) === 'loading';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+18
-7
@@ -1,10 +1,21 @@
|
||||
@import "{ohif:design}/app"
|
||||
@require '{ohif:design}/app'
|
||||
|
||||
.measurementTableTimepointCell
|
||||
theme('border-left', '%s solid $uiBorderColor' % $uiBorderThickness)
|
||||
theme('color', '$textPrimaryColor')
|
||||
padding: 0 10px
|
||||
cursor: pointer
|
||||
theme('border-left', '%s solid $uiBorderColor' % $uiBorderThickness)
|
||||
theme('color', '$textPrimaryColor')
|
||||
cursor: pointer
|
||||
padding: 0 10px
|
||||
position: relative
|
||||
|
||||
&:hover
|
||||
theme('color', '$activeColor')
|
||||
.loading-spinner
|
||||
display: none
|
||||
font-size: 16px
|
||||
position: absolute
|
||||
right: 5px
|
||||
top: 3px
|
||||
|
||||
&.loading .loading-spinner
|
||||
display: block
|
||||
|
||||
&:hover
|
||||
theme('color', '$activeColor')
|
||||
Reference in new issue
Block a user