Feature: Add PinEditorUI filter for buttons

This commit is contained in:
winkidney
2019-12-07 16:43:38 +08:00
committed by Isaac Bythewood
parent 5b5bb00174
commit 41851a09a8
3 changed files with 67 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="editor">
<div class="editor-buttons">
<span class="icon-container">
<span class="icon-container" v-if="inBoard">
<b-icon
type="is-light"
icon="minus-box"
@@ -15,14 +15,14 @@
custom-size="mdi-24px">
</b-icon>
</span>
<span class="icon-container" @click="deletePin">
<span class="icon-container" @click="deletePin" v-if="isOwner">
<b-icon
type="is-light"
icon="delete"
custom-size="mdi-24px">
</b-icon>
</span>
<span class="icon-container">
<span class="icon-container" v-if="isOwner">
<b-icon
type="is-light"
icon="pencil"
@@ -39,6 +39,14 @@ import API from '../api';
export default {
name: 'Editor',
props: {
currentBoardId: {
type: Number,
default: null,
},
currentUsername: {
default: '',
type: String,
},
pin: {
default() {
return {};
@@ -46,6 +54,14 @@ export default {
type: Object,
},
},
computed: {
isOwner() {
return this.pin.author === this.currentUsername;
},
inBoard() {
return this.currentBoardId !== null;
},
},
methods: {
deletePin() {
this.$buefy.dialog.confirm({