summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2019-07-20 17:50:01 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-07-20 17:50:01 +0900
commite695f54ef09e2c6daa17de764ab38b9e5bb0099c (patch)
treeec993fd621bf14605bc997d82bc299bec389f619 /src/client
parentFix: スクロールしてると絵文字ピッカーの位置がずれる (#... (diff)
downloadsharkey-e695f54ef09e2c6daa17de764ab38b9e5bb0099c.tar.gz
sharkey-e695f54ef09e2c6daa17de764ab38b9e5bb0099c.tar.bz2
sharkey-e695f54ef09e2c6daa17de764ab38b9e5bb0099c.zip
投稿フォームが画面外にはみ出さないように (#5203)
* 上下はみ出したウィンドウは上基準で収めるように * 投稿フォームを画面より長くしないように
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/desktop/views/components/post-form-window.vue8
-rw-r--r--src/client/app/desktop/views/components/window.vue16
2 files changed, 15 insertions, 9 deletions
diff --git a/src/client/app/desktop/views/components/post-form-window.vue b/src/client/app/desktop/views/components/post-form-window.vue
index ae5f0af71d..8dd7c584a2 100644
--- a/src/client/app/desktop/views/components/post-form-window.vue
+++ b/src/client/app/desktop/views/components/post-form-window.vue
@@ -10,7 +10,7 @@
</span>
</template>
- <div class="mk-post-form-window--body">
+ <div class="mk-post-form-window--body" :style="{ maxHeight: `${maxHeight}px` }">
<mk-note-preview v-if="reply" class="notePreview" :note="reply"/>
<x-post-form ref="form"
:reply="reply"
@@ -61,6 +61,12 @@ export default Vue.extend({
};
},
+ computed: {
+ maxHeight() {
+ return window.innerHeight - 50;
+ },
+ },
+
mounted() {
this.$nextTick(() => {
(this.$refs.form as any).focus();
diff --git a/src/client/app/desktop/views/components/window.vue b/src/client/app/desktop/views/components/window.vue
index 95d9e2feff..499f4e7c91 100644
--- a/src/client/app/desktop/views/components/window.vue
+++ b/src/client/app/desktop/views/components/window.vue
@@ -260,14 +260,14 @@ export default Vue.extend({
let moveLeft = me.clientX - moveBaseX;
let moveTop = me.clientY - moveBaseY;
- // 上はみ出し
- if (moveTop < 0) moveTop = 0;
+ // 下はみ出し
+ if (moveTop + windowHeight > browserHeight) moveTop = browserHeight - windowHeight;
// 左はみ出し
if (moveLeft < 0) moveLeft = 0;
- // 下はみ出し
- if (moveTop + windowHeight > browserHeight) moveTop = browserHeight - windowHeight;
+ // 上はみ出し
+ if (moveTop < 0) moveTop = 0;
// 右はみ出し
if (moveLeft + windowWidth > browserWidth) moveLeft = browserWidth - windowWidth;
@@ -442,10 +442,10 @@ export default Vue.extend({
const browserHeight = window.innerHeight;
const windowWidth = main.offsetWidth;
const windowHeight = main.offsetHeight;
- if (position.left < 0) main.style.left = 0;
- if (position.top < 0) main.style.top = 0;
- if (position.left + windowWidth > browserWidth) main.style.left = browserWidth - windowWidth + 'px';
- if (position.top + windowHeight > browserHeight) main.style.top = browserHeight - windowHeight + 'px';
+ if (position.left < 0) main.style.left = 0; // 左はみ出し
+ if (position.top + windowHeight > browserHeight) main.style.top = browserHeight - windowHeight + 'px'; // 下はみ出し
+ if (position.left + windowWidth > browserWidth) main.style.left = browserWidth - windowWidth + 'px'; // 右はみ出し
+ if (position.top < 0) main.style.top = 0; // 上はみ出し
}
}
});