diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-12-28 13:52:12 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-12-28 18:01:26 +1100 |
| commit | 6b8d7fcda5dc884086bfb5df914e3f13dca5ac3c (patch) | |
| tree | 7cdff34486263b80554d6be01f6157851857839c /src/components | |
| parent | 5d6b8333813bdb22b77ae7e02fb309af82873f56 (diff) | |
Don't re-query server for same range and scale
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/TimeLine.vue | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue index c909c67..b1607ef 100644 --- a/src/components/TimeLine.vue +++ b/src/components/TimeLine.vue @@ -160,7 +160,8 @@ const hasMinorScale = computed(() => { // If true, display subset of ticks of ne } return (availLen.value / numUnits) >= 2 * store.minTickSep; }); -const minorScale = computed(() => hasMinorScale.value ? SCALES[scaleIdx.value + 1] : scale.value); +const minorScaleIdx = computed(() => scaleIdx.value + (hasMinorScale.value ? 1 : 0)); +const minorScale = computed(() => SCALES[minorScaleIdx.value]); if (props.initialState.startOffset != null){ startOffset.value = props.initialState.startOffset as number; } @@ -561,15 +562,8 @@ const idToPos = computed(() => { } } } - // If more events could be displayed, notify parent - let colFillThreshold = (availLen.value - store.spacing) / (eventMajorSz.value + store.spacing) * 2/3; - let full = cols.every(col => col.length >= colFillThreshold); - if (!full){ - emit('event-req', firstDate.value, lastDate.value); - } else { // Send displayed event IDs to parent - emit('event-display', [...map.keys()], ID); - } - // + // Notify parent + emit('event-display', ID, [...map.keys()], firstDate.value, lastDate.value, minorScaleIdx.value); return map; }); |
