Frontend: Use $clipboard methods directly instead of props #15

This commit is contained in:
Michael Mayer 2019-05-21 13:44:06 +02:00
parent 4486e8b517
commit 280444022f
5 changed files with 5 additions and 9 deletions

View File

@ -41,7 +41,7 @@
<v-btn v-if="hover || $clipboard.has(photo)" :flat="!hover" :ripple="false"
icon large absolute
class="p-photo-select"
@click.stop.prevent="select(photo)">
@click.stop.prevent="$clipboard.toggle(photo)">
<v-icon v-if="selection.length && $clipboard.has(photo)" color="white">check_circle</v-icon>
<v-icon v-else color="grey lighten-3">radio_button_off</v-icon>
</v-btn>

View File

@ -13,7 +13,7 @@
<td>
<v-btn icon small :ripple="false"
class="p-photo-select"
@click.stop.prevent="select(props.item)">
@click.stop.prevent="$clipboard.toggle(photo)">
<v-icon v-if="selection.length && $clipboard.has(props.item)" color="grey darken-2">check_circle</v-icon>
<v-icon v-else-if="!$clipboard.has(props.item)" color="grey lighten-4">radio_button_off</v-icon>
</v-btn>

View File

@ -39,7 +39,7 @@
<v-btn v-if="hover || $clipboard.has(photo)" :flat="!hover" :ripple="false"
icon small absolute
class="p-photo-select"
@click.stop.prevent="select(photo)">
@click.stop.prevent="$clipboard.toggle(photo)">
<v-icon v-if="selection.length && $clipboard.has(photo)" color="white">check_circle</v-icon>
<v-icon v-else color="grey lighten-3">radio_button_off</v-icon>
</v-btn>

View File

@ -39,7 +39,7 @@
<v-btn v-if="hover || $clipboard.has(photo)" :flat="!hover" :ripple="false"
icon large absolute
class="p-photo-select"
@click.stop.prevent="select(photo)">
@click.stop.prevent="$clipboard.toggle(photo)">
<v-icon v-if="selection.length && $clipboard.has(photo)" color="white">check_circle</v-icon>
<v-icon v-else-if="!$clipboard.has(photo)" color="grey lighten-3">radio_button_off</v-icon>
</v-btn>

View File

@ -146,7 +146,7 @@
dark
small
color="grey"
@click.stop="clearSelection()"
@click.stop="$clipboard.clear()"
:disabled="!selected.length"
>
<v-icon>clear</v-icon>
@ -247,10 +247,6 @@
this.$alert.warning("Not implemented yet");
this.menuVisible = false;
},
clearSelection() {
this.selected = [];
this.menuVisible = false;
},
selectPhoto(photo) {
this.$clipboard.toggle(photo);
},