mirror of
https://github.com/pinry/pinry.git
synced 2025-11-18 02:40:40 +01:00
Feature: Add PinEditorUI filter for buttons
This commit is contained in:
committed by
Isaac Bythewood
parent
5b5bb00174
commit
41851a09a8
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user