Mercurial > gemma
diff client/src/application/Linetool.vue @ 649:83081ba6c9c1
feat: Linetool added
In order to draw lines for allocating profiles,
a basic implementation of line drawing was added.
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Thu, 13 Sep 2018 16:55:53 +0200 |
parents | |
children | f09cbe80a864 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/application/Linetool.vue Thu Sep 13 16:55:53 2018 +0200 @@ -0,0 +1,45 @@ +<template> + <div @click="drawLine" class="ui-element d-flex shadow drawtool"> + <i :class="icon"></i> + </div> +</template> + +<style lang="scss"> +.drawtool { + position: absolute; + bottom: 0; + right: 0; + background-color: white; + padding: $small-offset; + border-radius: $border-radius; + margin-left: $offset; + height: $icon-width; + width: $icon-height; + margin-bottom: $offset; + margin-right: $offset; + z-index: 2; +} +</style> + +<script> +import { mapGetters } from "vuex"; + +export default { + name: "linetool", + methods: { + drawLine() { + this.$store.commit("application/toggleDrawModeLine"); + } + }, + computed: { + ...mapGetters("application", ["drawMode"]), + icon() { + return { + fa: true, + "fa-pencil": !this.drawMode, + "fa-pencil-square": this.drawMode + }; + } + } +}; +</script>