rename post button depending on the chosen privacy/visibility

(e.g. to post publicly or post to followers)

Signed-off-by: Jonas Sulzer <jonas@violoncello.ch>
pull/16/head
Jonas Sulzer 2018-11-28 17:38:23 +01:00 zatwierdzone przez Julius Härtl
rodzic 4f9be4b5e9
commit be61c6f98b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4C614C6ED2CDE6DF
1 zmienionych plików z 21 dodań i 1 usunięć

Wyświetl plik

@ -58,7 +58,7 @@
</emoji-picker>
<div class="options">
<input :value="t('social', 'Post')" :disabled="post.length < 1" class="submit primary"
<input :value="currentVisibilityPostLabel" :disabled="post.length < 1" class="submit primary"
type="submit" title="" data-original-title="Post">
<div>
<button :class="currentVisibilityIconClass" @click.prevent="togglePopoverMenu" />
@ -365,6 +365,26 @@ export default {
}
}
},
currentVisibilityPostLabel() {
return this.visibilityPostLabel(this.type)
},
visibilityPostLabel() {
return (type) => {
if (typeof type === 'undefined') {
type = this.type
}
switch (type) {
case 'public':
return t('social', 'Post publicly')
case 'followers':
return t('social', 'Post to followers')
case 'direct':
return t('social', 'Post to recipients')
case 'unlisted':
return t('social', 'Post unlisted')
}
}
},
visibilityPopover() {
return [
{