changeset 997:26ca04caa330

fix: Setting selected Bottleneck null caused Nullpointer Exception. The computed property "selected Bottleneck" returns null, when no Bottleneck was found. Clicking on the map triggers as of now an "identify" operation. If no bottleneck is selected, the result of the property is null. In turn is referencing selectedBottleneck in templates screwed. For now: the text is only changed, when a new Bottleneck is selected.
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 22 Oct 2018 14:53:20 +0200
parents e03fab882b47
children 60ca5bd3e326 5981ff466cf4
files client/src/morphtool/Morphtool.vue
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/morphtool/Morphtool.vue	Mon Oct 22 13:12:28 2018 +0200
+++ b/client/src/morphtool/Morphtool.vue	Mon Oct 22 14:53:20 2018 +0200
@@ -2,7 +2,7 @@
     <div v-if="selectedBottleneck || selectedMorph" class="morphcontainer">
         <div v-if="surveyList && !drawMode" class="ui-element card card-body shadow">
             <div class="headline">
-                <h4>{{selectedBottleneck.get("objnam")}}</h4>
+                <h4>{{bottleneckName}}</h4>
                 <hr>
                 <div @click="clearSelection" class="float-left ui-element d-flex morphtoolminus">
                     <i class="fa fa-close morphtoolsminus"></i>
@@ -18,7 +18,7 @@
             <div class="d-flex flex-row justify-content-between">
                 <i class="fa fa-close text-danger"></i>
                 <small>Bottleneck:&nbsp;</small>
-                <h6>{{selectedBottleneck.get("objnam")}} <small>( {{selectedMorph.date_info}} )</small></h6>
+                <h6>{{bottleneckName}} <small>( {{selectedMorph.date_info}} )</small></h6>
             </div>
         </div>
     </div>
@@ -88,7 +88,8 @@
   name: "morphtool",
   data() {
     return {
-      surveyList: null
+      surveyList: null,
+      bottleneckName: ""
     };
   },
   computed: {
@@ -114,6 +115,7 @@
       if (bottleneckFeature) {
         let bottleneckName = bottleneckFeature.get("objnam");
         if (bottleneckName) {
+          this.bottleneckName = bottleneckName;
           this.queryBottleneck(bottleneckName);
         }
       }