Added copy as todo (#9884)

This commit is contained in:
Keith Holliday
2018-02-05 09:43:00 -07:00
committed by GitHub
parent 46877fb20c
commit 2d612b655d
2 changed files with 39 additions and 42 deletions

View File

@@ -18,11 +18,9 @@ div
.svg-icon(v-html="icons.like")
span(v-if='!msg.likes[user._id]') {{ $t('like') }}
span(v-if='msg.likes[user._id]') {{ $t('liked') }}
// @TODO make copyAsTodo work in Tavern, guilds, party (inbox can be done later)
span.action(v-if='!inbox', @click='copyAsTodo(msg)')
.svg-icon(v-html="icons.copy")
| {{$t('copyAsTodo')}}
// @TODO make copyAsTodo work in the inbox
span.action(v-if='!inbox', @click='copyAsTodo(msg)')
.svg-icon(v-html="icons.copy")
| {{$t('copyAsTodo')}}
span.action(v-if='!inbox && user.flags.communityGuidelinesAccepted && msg.uuid !== "system"', @click='report(msg)')
.svg-icon(v-html="icons.report")
| {{$t('report')}}
@@ -140,7 +138,6 @@ export default {
mixins: [styleHelper],
data () {
return {
copyingMessage: {},
icons: Object.freeze({
like: likeIcon,
copy: copyIcon,
@@ -241,9 +238,7 @@ export default {
this.$emit('messaged-liked', message);
},
copyAsTodo (message) {
// @TODO: Move to Habitica Event
this.copyingMessage = message;
this.$root.$emit('bv::show::modal', 'copyAsTodo');
this.$root.$emit('habitica::copy-as-todo', message);
},
async report () {
this.$root.$emit('habitica::report-chat', {