+
@@ -125,6 +133,7 @@
+
@@ -152,7 +161,8 @@ export default {
pollExpire: {
label: this.$t('modals.new_toot.poll.expires.1_day'),
value: 3600 * 24
- }
+ },
+ statusHeight: 240
}
},
computed: {
@@ -311,15 +321,23 @@ export default {
},
updateImage(file) {
this.$store.dispatch('TimelineSpace/Modals/NewToot/incrementMediaCount')
- this.$store.dispatch('TimelineSpace/Modals/NewToot/uploadImage', file).catch(() => {
- this.$message({
- message: this.$t('message.attach_error'),
- type: 'error'
+ this.$store
+ .dispatch('TimelineSpace/Modals/NewToot/uploadImage', file)
+ .then(() => {
+ this.statusHeight = this.statusHeight - this.$refs.preview.offsetHeight
+ })
+ .catch(() => {
+ this.$message({
+ message: this.$t('message.attach_error'),
+ type: 'error'
+ })
})
- })
},
removeAttachment(media) {
- this.$store.dispatch('TimelineSpace/Modals/NewToot/removeMedia', media)
+ const previousHeight = this.$refs.preview.offsetHeight
+ this.$store.dispatch('TimelineSpace/Modals/NewToot/removeMedia', media).then(() => {
+ this.statusHeight = this.statusHeight + previousHeight
+ })
},
changeVisibility(level) {
this.$store.commit('TimelineSpace/Modals/NewToot/changeVisibilityValue', level)
@@ -357,12 +375,22 @@ export default {
updateDescription(id, value) {
this.$store.commit('TimelineSpace/Modals/NewToot/updateMediaDescription', { id: id, description: value })
},
- togglePollForm() {
- this.openPoll = !this.openPoll
+ async togglePollForm() {
+ const previousHeight = this.$refs.poll ? this.$refs.poll.$el.offsetHeight : 0
+ const toggle = () => {
+ this.openPoll = !this.openPoll
+ if (this.openPoll) {
+ this.polls = ['', '']
+ } else {
+ this.polls = []
+ }
+ }
+ await toggle()
+ console.log(this.$refs.poll)
if (this.openPoll) {
- this.polls = ['', '']
+ this.statusHeight = this.statusHeight - this.$refs.poll.$el.offsetHeight
} else {
- this.polls = []
+ this.statusHeight = this.statusHeight + previousHeight
}
},
addPoll() {
@@ -373,6 +401,10 @@ export default {
},
changeExpire(obj) {
this.pollExpire = obj
+ },
+ handleResize(event) {
+ const pollHeight = this.$refs.poll ? this.$refs.poll.$el.offsetHeight : 0
+ this.statusHeight = event.height - 63 - 54 - this.$refs.preview.offsetHeight - pollHeight
}
}
}
@@ -380,6 +412,12 @@ export default {
From 39d9f68792218c872c328b13b60191d3911cee01 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Sat, 20 Jun 2020 23:47:09 +0900
Subject: [PATCH 3/5] refs #1316 Consider spoiler input field for resize new
toot window
---
.../TimelineSpace/Modals/NewToot.vue | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot.vue b/src/renderer/components/TimelineSpace/Modals/NewToot.vue
index 6330ff9a..dbc18157 100644
--- a/src/renderer/components/TimelineSpace/Modals/NewToot.vue
+++ b/src/renderer/components/TimelineSpace/Modals/NewToot.vue
@@ -3,12 +3,12 @@
:title="$t('modals.new_toot.title')"
:visible.sync="newTootModal"
:before-close="closeConfirm"
- width="400px"
+ width="600px"
class="new-toot-modal"
ref="dialog"
>
-
+
@@ -104,7 +104,7 @@
Date: Sun, 21 Jun 2020 01:01:30 +0900
Subject: [PATCH 4/5] refs #1316 Consider suggest list for resize new toot
window
---
src/renderer/components/TimelineSpace/Modals/NewToot.vue | 5 +++--
.../components/TimelineSpace/Modals/NewToot/Status.vue | 8 +++++++-
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot.vue b/src/renderer/components/TimelineSpace/Modals/NewToot.vue
index dbc18157..6c79443c 100644
--- a/src/renderer/components/TimelineSpace/Modals/NewToot.vue
+++ b/src/renderer/components/TimelineSpace/Modals/NewToot.vue
@@ -20,7 +20,8 @@
:height="statusHeight"
@paste="onPaste"
@toot="toot"
- @pickerOpened="pickerOpened"
+ @pickerOpened="innerElementOpened"
+ @suggestOpened="innerElementOpened"
/>
Date: Sun, 21 Jun 2020 21:43:20 +0900
Subject: [PATCH 5/5] refs #1316 Fix handle close event for emoji picker
---
src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue b/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue
index 99d5f822..6a19d3ae 100644
--- a/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue
+++ b/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue
@@ -259,7 +259,7 @@ export default {
},
hideEmojiPicker() {
if (this.openEmojiPicker) {
- this.$emit('pickerOpened', this.openEmojiPicker)
+ this.$emit('pickerOpened', false)
}
this.openEmojiPicker = false
},