Mercurial > gemma
view client/src/layers/Layers.vue @ 771:6d214b3bed35
client: improve identify box' dynamic sizing
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Wed, 26 Sep 2018 09:46:07 +0200 |
parents | 3e2eeb215d0e |
children | 55fb73a3ebf7 |
line wrap: on
line source
<template> <div class="layerselectmenu"> <div @click="collapse" class="d-flex flex-column ui-element minimizer"> <div> <i class="fa fa-th-list"></i> </div> </div> <div :class="layerSelectStyle"> <div v-if="!collapsed" class="card-body"> <div class="headline"> <h4 class="card-title">Layers</h4> </div> <hr> <div class="d-flex flex-column"> <Layerselect :layerindex="index" :layername="layer.name" v-for="(layer, index) in layers" :key="layer.name" :isVisible="layer.isVisible" @visibilityToggled="visibilityToggled"></Layerselect> </div> </div> </div> </div> </template> <style lang="scss"> .layerselectmenu { position: relative; margin-right: $offset; } .layerselection { background-color: white; margin-left: $small-offset; opacity: $slight-transparent; } .layerselectioncollapsed { height: $icon-height; width: $icon-width; transition: $transition-fast; } .layerselectionexpanded { height: $layerselect-height; width: $layerselect-width; } .minimizer { position: absolute; z-index: 2; right: 0; margin-top: $x-small-offset; border-radius: $border-radius; height: $icon-width; width: $icon-height; } </style> <script> import Layerselect from "./Layerselect"; import { mapGetters } from "vuex"; export default { name: "layers", data() { return { collapsed: false }; }, components: { Layerselect }, computed: { ...mapGetters("mapstore", ["layers"]), layerSelectStyle() { return { "ui-element": true, card: true, layerselection: true, shadow: true, layerselectionexpanded: !this.collapsed, layerselectioncollapsed: this.collapsed }; } }, methods: { collapse() { this.collapsed = !this.collapsed; }, visibilityToggled(layer) { this.$store.commit("mapstore/toggleVisibility", layer); } } }; </script>