Fix successful submit

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/18/head
Julius Härtl 2018-11-15 12:59:47 +01:00
rodzic 101795d5b0
commit 4377d02305
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4C614C6ED2CDE6DF
2 zmienionych plików z 7 dodań i 4 usunięć

Wyświetl plik

@ -34,7 +34,7 @@
<div v-contenteditable contenteditable="true" ref="composerInput" class="message" placeholder="Share a thought…" @input="updateInput" v-model="post"></div>
</vue-tribute>
<input class="submit icon-confirm has-tooltip" type="submit" value=""
title="" data-original-title="Post">
title="" data-original-title="Post" :disabled="post.length < 1">
<div class="submitLoading icon-loading-small hidden" />
</form>
@ -90,6 +90,7 @@
.message {
width: 100%;
padding-right: 44px;
}
.author .social-id {
@ -286,8 +287,10 @@ export default {
this.$store.dispatch('post', {
content: this.post,
type: this.type,
}).then((response) => { response.length > 0 ? $state.loaded() : $state.complete() });
event.preventDefault()
}).then((response) => {
this.post = ''
this.$refs.composerInput.innerText = this.post
});
}
},
data() {

Wyświetl plik

@ -41,7 +41,7 @@ const getters = {
}
const actions = {
post(context, post) {
axios.post(OC.generateUrl('apps/social/api/v1/post'), {data: post}).then((response) => {
return axios.post(OC.generateUrl('apps/social/api/v1/post'), {data: post}).then((response) => {
let uid = ''
context.commit('addPost', { uid: uid, data: response.data })
})