changeset 5487:e8dc7a7aec41

Merged
author Sascha Wilde <wilde@sha-bang.de>
date Fri, 20 Aug 2021 13:01:49 +0200
parents 6ab3f5df30d2 (current diff) 89b6978afc58 (diff)
children a726a92ea5c9
files
diffstat 2 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/fairway/AvailableFairwayDepth.vue	Thu Aug 19 22:38:54 2021 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepth.vue	Fri Aug 20 13:01:49 2021 +0200
@@ -444,7 +444,10 @@
       }
     },
     legendStyle(index) {
-      if (this.depthlimit1 === this.depthlimit2) {
+      if (
+        (this.depthlimit1 && this.depthlimit1 === this.depthlimit2) ||
+        (this.widthlimit1 && this.widthlimit1 === this.widthlimit2)
+      ) {
         let result = [
           `background-color: ${this.$options.COLORS.LDC};`,
           `background-color: ${this.$options.COLORS.HIGHEST};`
--- a/client/src/components/fairway/AvailableFairwayDepthLNWL.vue	Thu Aug 19 22:38:54 2021 +0200
+++ b/client/src/components/fairway/AvailableFairwayDepthLNWL.vue	Fri Aug 20 13:01:49 2021 +0200
@@ -192,12 +192,15 @@
       "widthlimit2"
     ]),
     legendLNWL() {
-      const d = [this.depthlimit1D, this.depthlimit2D].sort();
-      const w = [this.widthlimit1D, this.widthlimit2D].sort();
+      const d = [this.depthlimit1D, this.depthlimit2D].sort((a, b) => a - b);
+      const w = [this.widthlimit1D, this.widthlimit2D].sort((a, b) => a - b);
       const lowerBound = [d[0] / 100, w[0]].filter(x => x).join(", ");
       const upperBound = [d[1] / 100, w[1]].filter(x => x).join(", ");
       let result;
-      if (this.depthlimit1D !== this.depthlimit2D) {
+      if (
+        this.depthlimit1D !== this.depthlimit2D ||
+        this.widthlimit1 !== this.widthlimit2
+      ) {
         result = [
           `> LDC`,
           `< ${lowerBound} [m]`,
@@ -325,7 +328,10 @@
     },
     legendStyle(index) {
       let style;
-      if (this.depthlimit1 !== this.depthlimit2) {
+      if (
+        this.depthlimit1 !== this.depthlimit2 ||
+        this.widthlimit1 !== this.widthlimit2
+      ) {
         style = {
           0: `background-color: ${this.$options.LWNLCOLORS.LDC};`,
           1: `background-color: ${this.$options.AFDCOLORS[2]};`,