mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-25 08:13:08 +02:00
parent
86d4f1981c
commit
eefeb4c268
1 changed files with 9 additions and 2 deletions
|
@ -36,7 +36,7 @@
|
||||||
</x-draggable>
|
</x-draggable>
|
||||||
<p class="remain">{{ 4 - files.length }}/4</p>
|
<p class="remain">{{ 4 - files.length }}/4</p>
|
||||||
</div>
|
</div>
|
||||||
<mk-poll-editor v-if="poll" ref="poll" @destroyed="poll = false" @updated="saveDraft()"/>
|
<mk-poll-editor v-if="poll" ref="poll" @destroyed="poll = false" @updated="onPollUpdate()"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<mk-uploader ref="uploader" @uploaded="attachMedia" @change="onChangeUploadings"/>
|
<mk-uploader ref="uploader" @uploaded="attachMedia" @change="onChangeUploadings"/>
|
||||||
|
@ -109,6 +109,7 @@ export default Vue.extend({
|
||||||
files: [],
|
files: [],
|
||||||
uploadings: [],
|
uploadings: [],
|
||||||
poll: false,
|
poll: false,
|
||||||
|
pollChoices: [],
|
||||||
useCw: false,
|
useCw: false,
|
||||||
cw: null,
|
cw: null,
|
||||||
geo: null,
|
geo: null,
|
||||||
|
@ -166,7 +167,8 @@ export default Vue.extend({
|
||||||
canPost(): boolean {
|
canPost(): boolean {
|
||||||
return !this.posting &&
|
return !this.posting &&
|
||||||
(1 <= this.text.length || 1 <= this.files.length || this.poll || this.renote) &&
|
(1 <= this.text.length || 1 <= this.files.length || this.poll || this.renote) &&
|
||||||
(length(this.text.trim()) <= this.maxNoteTextLength);
|
(length(this.text.trim()) <= this.maxNoteTextLength) &&
|
||||||
|
(!this.poll || this.pollChoices.length >= 2);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -277,6 +279,11 @@ export default Vue.extend({
|
||||||
Array.from((this.$refs.file as any).files).forEach(this.upload);
|
Array.from((this.$refs.file as any).files).forEach(this.upload);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onPollUpdate() {
|
||||||
|
this.pollChoices = this.$refs.poll.get().choices;
|
||||||
|
this.saveDraft();
|
||||||
|
}
|
||||||
|
|
||||||
upload(file) {
|
upload(file) {
|
||||||
(this.$refs.uploader as any).upload(file);
|
(this.$refs.uploader as any).upload(file);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue