diff options
| author | Terry Truong <terry06890@gmail.com> | 2022-10-15 13:22:09 +1100 |
|---|---|---|
| committer | Terry Truong <terry06890@gmail.com> | 2022-10-15 13:22:09 +1100 |
| commit | 3932d067cfca46130a82f95ac40638ebfeca5181 (patch) | |
| tree | b72ef24539b76b566e2fe6757c22a714f961d831 | |
| parent | f06321dea2738e339f83c8cc08e9fa829e0da0d4 (diff) | |
Prevent zooming in beyond min/max dates
| -rw-r--r-- | src/components/TimeLine.vue | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/components/TimeLine.vue b/src/components/TimeLine.vue index 8301dba..22069bc 100644 --- a/src/components/TimeLine.vue +++ b/src/components/TimeLine.vue @@ -491,6 +491,10 @@ function zoomTimeline(zoomRatio: number){ console.log('Unable to zoom into range where month/day scale is invalid'); return; } + if (newStart.isEarlier(MIN_DATE, newScale) || MAX_DATE.isEarlier(newEnd, newScale)){ + console.log('Disallowing zooming in beyond min/max dates'); + return; + } scaleIdx.value += 1; } } |
