From e695f54ef09e2c6daa17de764ab38b9e5bb0099c Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Sat, 20 Jul 2019 17:50:01 +0900 Subject: [PATCH] =?UTF-8?q?=E6=8A=95=E7=A8=BF=E3=83=95=E3=82=A9=E3=83=BC?= =?UTF-8?q?=E3=83=A0=E3=81=8C=E7=94=BB=E9=9D=A2=E5=A4=96=E3=81=AB=E3=81=AF?= =?UTF-8?q?=E3=81=BF=E5=87=BA=E3=81=95=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=20(#5203)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 上下はみ出したウィンドウは上基準で収めるように * 投稿フォームを画面より長くしないように --- .../views/components/post-form-window.vue | 8 +++++++- .../app/desktop/views/components/window.vue | 16 ++++++++-------- 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 ae5f0af71..8dd7c584a 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 @@ -
+
{ (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 95d9e2fef..499f4e7c9 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; // 上はみ出し } } });