changeset 3077:db890b71f070

client: panes: added paneId to mixin
author Markus Kottlaender <markus@intevation.de>
date Thu, 18 Apr 2019 08:41:43 +0200
parents e0daeb05bf50
children 71129566acdf
files client/src/components/map/Map.vue client/src/lib/mixins.js
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/map/Map.vue	Wed Apr 17 15:04:28 2019 +0200
+++ b/client/src/components/map/Map.vue	Thu Apr 18 08:41:43 2019 +0200
@@ -43,14 +43,14 @@
 import { Map, View } from "ol";
 import { Stroke, Style, Fill } from "ol/style";
 import { displayError } from "@/lib/errors";
-import { uuid, paneHooks } from "@/lib/mixins";
+import { uuid, pane } from "@/lib/mixins";
 import layers from "@/components/map/layers";
 import "ol/ol.css";
 
 /* for the sake of debugging */
 /* eslint-disable no-console */
 export default {
-  mixins: [uuid, paneHooks],
+  mixins: [uuid, pane],
   data() {
     return {
       map: null,
--- a/client/src/lib/mixins.js	Wed Apr 17 15:04:28 2019 +0200
+++ b/client/src/lib/mixins.js	Thu Apr 18 08:41:43 2019 +0200
@@ -39,13 +39,18 @@
   }
 };
 
-const paneHooks = {
+const pane = {
   props: {
     paneCreated: Function,
     paneMounted: Function,
     paneUpdated: Function,
     paneDestroyed: Function
   },
+  computed: {
+    paneId() {
+      return this.$parent.pane.id;
+    }
+  },
   created() {
     if (this.paneCreated) this.paneCreated();
   },
@@ -60,4 +65,4 @@
   }
 };
 
-export { sortTable, uuid, paneHooks };
+export { sortTable, uuid, pane };