diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-03-13 14:23:29 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-03-13 14:23:29 +0900 |
| commit | a26236cade80d6f70298c67ed73cfcaf340d9e9d (patch) | |
| tree | 3b25e7f6e9c7f9e83792dd393a759311d63e6e88 /src/web/app | |
| parent | Revert "fix" (diff) | |
| download | misskey-a26236cade80d6f70298c67ed73cfcaf340d9e9d.tar.gz misskey-a26236cade80d6f70298c67ed73cfcaf340d9e9d.tar.bz2 misskey-a26236cade80d6f70298c67ed73cfcaf340d9e9d.zip | |
[Client] :v:
Diffstat (limited to 'src/web/app')
| -rw-r--r-- | src/web/app/mobile/tags/page/home.tag | 5 | ||||
| -rw-r--r-- | src/web/app/mobile/tags/ui-header.tag | 27 |
2 files changed, 25 insertions, 7 deletions
diff --git a/src/web/app/mobile/tags/page/home.tag b/src/web/app/mobile/tags/page/home.tag index c93803fb02..68178aa991 100644 --- a/src/web/app/mobile/tags/page/home.tag +++ b/src/web/app/mobile/tags/page/home.tag @@ -12,6 +12,7 @@ this.mixin('ui-progress'); this.mixin('stream'); this.mixin('get-post-summary'); + this.mixin('open-post-form'); this.unreadCount = 0; @@ -19,6 +20,10 @@ document.title = 'Misskey' this.ui.trigger('title', '<i class="fa fa-home"></i>ホーム'); + this.ui.trigger('func', () => { + this.openPostForm(); + }, 'pencil'); + this.Progress.start(); this.stream.on('post', this.onStreamPost); diff --git a/src/web/app/mobile/tags/ui-header.tag b/src/web/app/mobile/tags/ui-header.tag index b6d2e28beb..265f12fd45 100644 --- a/src/web/app/mobile/tags/ui-header.tag +++ b/src/web/app/mobile/tags/ui-header.tag @@ -5,7 +5,7 @@ <div class="content"> <button class="nav" onclick={ parent.toggleDrawer }><i class="fa fa-bars"></i></button> <h1 ref="title">Misskey</h1> - <button class="post" onclick={ post }><i class="fa fa-pencil"></i></button> + <button if={ func } onclick={ func }><i class="fa fa-{ funcIcon }"></i></button> </div> </div> <style> @@ -74,7 +74,7 @@ > i transition all 0.2s ease - > .post + > button:last-child display block position absolute top 0 @@ -89,14 +89,27 @@ </style> <script> this.mixin('ui'); - this.mixin('open-post-form'); - this.ui.on('title', title => { - if (this.refs.title) this.refs.title.innerHTML = title; + this.func = null; + this.funcIcon = null; + + this.on('unmount', () => { + this.ui.off('title', this.setTitle); + this.ui.off('func', this.setFunc); }); - this.post = () => { - this.openPostForm(); + this.setTitle = title => { + this.refs.title.innerHTML = title; + }; + + this.setFunc = (fn, icon) => { + this.update({ + func: fn, + funcIcon: icon + }); }; + + this.ui.on('title', this.setTitle); + this.ui.on('func', this.setFunc); </script> </mk-ui-header> |