Mercurial > gemma
view client/src/layers/Layers.vue @ 1201:37889ae85133
moved search icon/bar to the left, next to main menu
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Mon, 19 Nov 2018 09:09:27 +0100 |
parents | 1ae93a0438df |
children | 4f666dbb9abd |
line wrap: on
line source
<template> <div class="layerselectmenu"> <div @click="$store.commit('application/showLayers', !showLayers)" class="d-flex flex-column ui-element minimizer"> <div> <i class="fa fa-th-list"></i> </div> </div> <div :class="layerSelectStyle"> <div v-if="showLayers" class="card-body layers"> <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 layersForLegend" :key="layer.name" :isVisible="layer.isVisible" @visibilityToggled="visibilityToggled"></Layerselect> </div> </div> </div> </div> </template> <style lang="sass" scoped> .layerselectmenu position: relative margin-left: auto .layerselection background-color: white opacity: $slight-transparent .layerselectioncollapsed min-height: $icon-height width: $icon-width transition: $transition-fast .layerselectionexpanded min-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> /* * This is Free Software under GNU Affero General Public License v >= 3.0 * without warranty, see README.md and license for details. * * SPDX-License-Identifier: AGPL-3.0-or-later * License-Filename: LICENSES/AGPL-3.0.txt * * Copyright (C) 2018 by via donau * – Österreichische Wasserstraßen-Gesellschaft mbH * Software engineering by Intevation GmbH * * Author(s): * Thomas Junk <thomas.junk@intevation.de> */ import Layerselect from "./Layerselect"; import { mapGetters, mapState } from "vuex"; export default { name: "layers", components: { Layerselect }, computed: { ...mapGetters("map", ["layersForLegend"]), ...mapState("application", ["showLayers"]), layerSelectStyle() { return { "ui-element": true, card: true, layerselection: true, shadow: true, layerselectionexpanded: this.showLayers, layerselectioncollapsed: !this.showLayers }; } }, methods: { visibilityToggled(layer) { this.$store.commit("map/toggleVisibility", layer); } } }; </script>