summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-24 18:53:22 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-24 18:53:22 +0900
commita1ab312c817d7670fe544ba02daebeac24663ab9 (patch)
tree92950e42757a3a18bc2a9d11ee1a529aec921b8a /src
parent[Client] 良い感じに (diff)
downloadmisskey-a1ab312c817d7670fe544ba02daebeac24663ab9.tar.gz
misskey-a1ab312c817d7670fe544ba02daebeac24663ab9.tar.bz2
misskey-a1ab312c817d7670fe544ba02daebeac24663ab9.zip
[Client] 良い感じに
Diffstat (limited to 'src')
-rw-r--r--src/web/app/common/tags/messaging/room.tag25
-rw-r--r--src/web/app/mobile/tags/page/messaging-room.tag2
2 files changed, 18 insertions, 9 deletions
diff --git a/src/web/app/common/tags/messaging/room.tag b/src/web/app/common/tags/messaging/room.tag
index c7fed91db3..4393ea9b86 100644
--- a/src/web/app/common/tags/messaging/room.tag
+++ b/src/web/app/common/tags/messaging/room.tag
@@ -1,13 +1,12 @@
<mk-messaging-room>
<div class="stream">
- <p class="initializing" if={ init }><i class="fa fa-spinner fa-spin"></i>読み込み中</p>
- <p class="empty" if={ !init && messages.length == 0 }><i class="fa fa-info-circle"></i>このユーザーとまだ会話したことがありません</p>
+ <p class="init" if={ init }><i class="fa fa-spinner fa-spin"></i>読み込み中</p>
+ <p class="empty" if={ !init && messages.length == 0 }><i class="fa fa-info-circle"></i>このユーザーと話したことはありません</p>
<virtual each={ message, i in messages }>
<mk-messaging-message message={ message }></mk-messaging-message>
<p class="date" if={ i != messages.length - 1 && message._date != messages[i + 1]._date }><span>{ messages[i + 1]._datetext }</span></p>
</virtual>
</div>
- <div class="typings"></div>
<footer>
<div ref="notifications"></div>
<div class="grippie" title="ドラッグしてフォームの広さを調整"></div>
@@ -132,6 +131,7 @@
this.init = true;
this.sending = false;
this.messages = [];
+ this.isNaked = this.opts.isNaked;
this.connection = new this.MessagingStreamConnection(this.I, this.user.id);
@@ -169,7 +169,7 @@
});
this.onMessage = (message) => {
- const isbottom = this.isBottom();
+ const isBottom = this.isBottom();
this.messages.push(message);
if (message.user_id != this.I.id && !document.hidden) {
@@ -201,13 +201,22 @@
};
this.isBottom = () => {
- const current = this.root.scrollTop + this.root.offsetHeight;
- const max = this.root.scrollHeight;
- return current > (max - 32);
+ const asobi = 32;
+ const current = this.isNaked
+ ? window.scrollY + window.innerHeight
+ : this.root.scrollTop + this.root.offsetHeight;
+ const max = this.isNaked
+ ? document.body.offsetHeight
+ : this.root.scrollHeight;
+ return current > (max - asobi);
};
this.scrollToBottom = () => {
- this.root.scrollTop = this.root.scrollHeight;
+ if (this.isNaked) {
+ window.scroll(0, document.body.offsetHeight);
+ } else {
+ this.root.scrollTop = this.root.scrollHeight;
+ }
};
this.notify = message => {
diff --git a/src/web/app/mobile/tags/page/messaging-room.tag b/src/web/app/mobile/tags/page/messaging-room.tag
index 29657802a6..8ba5bd2c2a 100644
--- a/src/web/app/mobile/tags/page/messaging-room.tag
+++ b/src/web/app/mobile/tags/page/messaging-room.tag
@@ -1,6 +1,6 @@
<mk-messaging-room-page>
<mk-ui ref="ui">
- <mk-messaging-room if={ !parent.fetching } user={ parent.user }></mk-messaging-room>
+ <mk-messaging-room if={ !parent.fetching } user={ parent.user } is-naked={ true }></mk-messaging-room>
</mk-ui>
<style>
:scope