This commit is contained in:
syuilo 2018-02-17 03:18:48 +09:00
parent 684662a475
commit 8e9e796b43
6 changed files with 71 additions and 73 deletions

View file

@ -12,6 +12,7 @@ import images from './images.vue';
import uploader from './uploader.vue';
import specialMessage from './special-message.vue';
import streamIndicator from './stream-indicator.vue';
import ellipsis from './ellipsis.vue';
Vue.component('mk-signin', signin);
Vue.component('mk-signup', signup);
@ -25,3 +26,4 @@ Vue.component('mk-images', images);
Vue.component('mk-uploader', uploader);
Vue.component('mk-special-message', specialMessage);
Vue.component('mk-stream-indicator', streamIndicator);
Vue.component('mk-ellipsis', ellipsis);

View file

@ -1,5 +1,5 @@
<template>
<time>
<time class="mk-time">
<span v-if=" mode == 'relative' ">{{ relative }}</span>
<span v-if=" mode == 'absolute' ">{{ absolute }}</span>
<span v-if=" mode == 'detail' ">{{ absolute }} ({{ relative }})</span>

View file

@ -6,7 +6,7 @@
<div class="main">
<header>
<a class="name" :href="`/${post.user.username}`" v-user-preview="post.user_id">{{ post.user.name }}</a>
<span class="username">@{ post.user.username }</span>
<span class="username">@{{ post.user.username }}</span>
<a class="time" :href="`/${post.user.username}/${post.id}`">
<mk-time :time="post.created_at"/></a>
</header>
@ -31,17 +31,11 @@ export default Vue.extend({
});
</script>
<style lang="stylus" scoped>
.mk-post-preview
display block
margin 0
padding 0
font-size 0.9em
background #fff
> article
&:after
content ""
display block

View file

@ -1,9 +1,7 @@
<template>
<mk-window ref="window" is-modal @closed="$destroy">
<span slot="header" :class="$style.header">%fa:retweet%%i18n:desktop.tags.mk-repost-form-window.title%</span>
<div slot="content">
<mk-repost-form ref="form" :post="post" @posted="$refs.window.close" @canceled="$refs.window.close"/>
</div>
<mk-repost-form ref="form" :post="post" @posted="onPosted" @canceled="onCanceled"/>
</mk-window>
</template>
@ -25,6 +23,12 @@ export default Vue.extend({
(this.$refs.window as any).close();
}
}
},
onPosted() {
(this.$refs.window as any).close();
},
onCanceled() {
(this.$refs.window as any).close();
}
}
});

View file

@ -3,7 +3,7 @@
<mk-post-preview :post="post"/>
<template v-if="!quote">
<footer>
<a class="quote" v-if="!quote" @click="onquote">%i18n:desktop.tags.mk-repost-form.quote%</a>
<a class="quote" v-if="!quote" @click="onQuote">%i18n:desktop.tags.mk-repost-form.quote%</a>
<button class="cancel" @click="cancel">%i18n:desktop.tags.mk-repost-form.cancel%</button>
<button class="ok" @click="ok" :disabled="wait">{{ wait ? '%i18n:desktop.tags.mk-repost-form.reposting%' : '%i18n:desktop.tags.mk-repost-form.repost%' }}</button>
</footer>
@ -46,7 +46,9 @@ export default Vue.extend({
onQuote() {
this.quote = true;
this.$nextTick(() => {
(this.$refs.form as any).focus();
});
},
onChildFormPosted() {
this.$emit('posted');
@ -61,9 +63,6 @@ export default Vue.extend({
> .mk-post-preview
margin 16px 22px
> div
padding 16px
> footer
height 72px
background lighten($theme-color, 95%)

View file

@ -55,7 +55,6 @@ export default {
},
unbind(el, binding, vn) {
const self = vn.context._userPreviewDirective_;
console.log('unbound:', self.user);
clearTimeout(self.showTimer);
clearTimeout(self.hideTimer);
self.close();