diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-02-25 14:45:43 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-02-25 14:45:43 +0900 |
| commit | 8cf95522aad19a5a9a97e4fa2ad75de008ed37fb (patch) | |
| tree | a8f9991a88dbdcf8b4fdc185362652c8352e1c7f /src | |
| parent | [Client] Fix bug (diff) | |
| download | sharkey-8cf95522aad19a5a9a97e4fa2ad75de008ed37fb.tar.gz sharkey-8cf95522aad19a5a9a97e4fa2ad75de008ed37fb.tar.bz2 sharkey-8cf95522aad19a5a9a97e4fa2ad75de008ed37fb.zip | |
Fix #204
Diffstat (limited to 'src')
| -rw-r--r-- | src/web/app/desktop/tags/post-detail-sub.tag | 27 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/post-detail.tag | 8 |
2 files changed, 24 insertions, 11 deletions
diff --git a/src/web/app/desktop/tags/post-detail-sub.tag b/src/web/app/desktop/tags/post-detail-sub.tag index f1b3c915cb..3093d461f0 100644 --- a/src/web/app/desktop/tags/post-detail-sub.tag +++ b/src/web/app/desktop/tags/post-detail-sub.tag @@ -1,14 +1,25 @@ -<mk-post-detail-sub title={ title }><a class="avatar-anchor" href={ CONFIG.url + '/' + post.user.username }><img class="avatar" src={ post.user.avatar_url + '?thumbnail&size=64' } alt="avatar" data-user-preview={ post.user_id }/></a> +<mk-post-detail-sub title={ title }> + <a class="avatar-anchor" href={ CONFIG.url + '/' + post.user.username }> + <img class="avatar" src={ post.user.avatar_url + '?thumbnail&size=64' } alt="avatar" data-user-preview={ post.user_id }/> + </a> <div class="main"> <header> - <div class="left"><a class="name" href={ CONFIG.url + '/' + post.user.username } data-user-preview={ post.user_id }>{ post.user.name }</a><span class="username">@{ post.user.username }</span></div> - <div class="right"><a class="time" href={ url }> - <mk-time time={ post.created_at }></mk-time></a></div> + <div class="left"> + <a class="name" href={ CONFIG.url + '/' + post.user.username } data-user-preview={ post.user_id }>{ post.user.name }</a> + <span class="username">@{ post.user.username }</span> + </div> + <div class="right"> + <a class="time" href={ url }> + <mk-time time={ post.created_at }></mk-time> + </a> + </div> </header> <div class="body"> <div class="text" ref="text"></div> <div class="media" if={ post.media }> - <virtual each={ file in post.media }><img src={ file.url + '?thumbnail&size=512' } alt={ file.name } title={ file.name }/></virtual> + <virtual each={ file in post.media }> + <img src={ file.url + '?thumbnail&size=512' } alt={ file.name } title={ file.name }/> + </virtual> </div> </div> </div> @@ -115,10 +126,10 @@ this.title = this.dateStringify(this.post.created_at); this.on('mount', () => { - if (this.p.text) { - const tokens = this.analyze(this.p.text); + if (this.post.text) { + const tokens = this.analyze(this.post.text); - this.refs.text.innerHTML = this.refs.text.innerHTML.replace('<p class="dummy"></p>', this.compile(tokens)); + this.refs.text.innerHTML = this.compile(tokens); this.refs.text.children.forEach(e => { if (e.tagName == 'MK-URL') riot.mount(e); diff --git a/src/web/app/mobile/tags/post-detail.tag b/src/web/app/mobile/tags/post-detail.tag index e8149e0982..900bd228c9 100644 --- a/src/web/app/mobile/tags/post-detail.tag +++ b/src/web/app/mobile/tags/post-detail.tag @@ -41,8 +41,10 @@ <virtual each={ file in p.media }><img src={ file.url + '?thumbnail&size=512' } alt={ file.name } title={ file.name }/></virtual> </div> <mk-poll if={ p.poll } post={ p }></mk-poll> - </div><a class="time" href={ url }> - <mk-time time={ p.created_at } mode="detail"></mk-time></a> + </div> + <a class="time" href={ url }> + <mk-time time={ p.created_at } mode="detail"></mk-time> + </a> <footer> <button onclick={ reply } title="返信"><i class="fa fa-reply"></i> <p class="count" if={ p.replies_count > 0 }>{ p.replies_count }</p> @@ -82,7 +84,7 @@ </article> <div class="replies"> <virtual each={ post in replies }> - <mk-post-detail-sub post={ post }></mk-post-detail-sub> + <mk-post-preview post={ post }></mk-post-preview> </virtual> </div> </div> |