From ea70350dcc41a142653f09341b100d7f5712ed99 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 7 Feb 2018 15:34:08 +0900 Subject: [PATCH] wip --- src/web/app/common/tags/reaction-picker.vue | 31 +++++++++------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/src/web/app/common/tags/reaction-picker.vue b/src/web/app/common/tags/reaction-picker.vue index 243039030..970b7036d 100644 --- a/src/web/app/common/tags/reaction-picker.vue +++ b/src/web/app/common/tags/reaction-picker.vue @@ -2,7 +2,7 @@
-

{ title }

+

{{ title }}

@@ -22,10 +22,15 @@ import anime from 'animejs'; import api from '../scripts/api'; + const placeholder = '%i18n:common.tags.mk-reaction-picker.choose-reaction%'; + export default { props: ['post', 'cb'], + data: { + title: placeholder + }, methods: { - react: function (reaction) { + react: function(reaction) { api('posts/reactions/create', { post_id: this.post.id, reaction: reaction @@ -33,6 +38,12 @@ if (this.cb) this.cb(); this.$destroy(); }); + }, + onMouseover: function(e) { + this.title = e.target.title; + }, + onMouseout: function(e) { + this.title = placeholder; } } }; @@ -42,22 +53,6 @@ this.post = this.opts.post; this.source = this.opts.source; - const placeholder = '%i18n:common.tags.mk-reaction-picker.choose-reaction%'; - - this.title = placeholder; - - this.onmouseover = e => { - this.update({ - title: e.target.title - }); - }; - - this.onmouseout = () => { - this.update({ - title: placeholder - }); - }; - this.on('mount', () => { const rect = this.source.getBoundingClientRect(); const width = this.refs.popover.offsetWidth;