From bceb02d760f53877f0f677144bc468ffbc4e66f2 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 16 Nov 2018 05:47:29 +0900 Subject: local only visibility (#3254) * local only visibility * fix UI --- src/client/app/mobile/views/components/note.vue | 24 +++++++++++++++++++--- .../app/mobile/views/components/post-form.vue | 11 +++++++++- 2 files changed, 31 insertions(+), 4 deletions(-) (limited to 'src/client/app/mobile/views') diff --git a/src/client/app/mobile/views/components/note.vue b/src/client/app/mobile/views/components/note.vue index d42efbf344..38fab0e5a1 100644 --- a/src/client/app/mobile/views/components/note.vue +++ b/src/client/app/mobile/views/components/note.vue @@ -16,6 +16,15 @@ {{ note.user | userName }} {{ this.$t('reposted-by').substr(this.$t('reposted-by').indexOf('}') + 1) }} + + + + + + + + +
@@ -163,9 +172,6 @@ export default Vue.extend({ > span flex-shrink 0 - &:last-of-type - margin-right 8px - .name overflow hidden flex-shrink 1 @@ -179,6 +185,18 @@ export default Vue.extend({ flex-shrink 0 font-size 0.9em + > .visibility + margin-left 8px + + [data-icon] + margin-right 0 + + > .localOnly + margin-left 4px + + [data-icon] + margin-right 0 + & + article padding-top 8px diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue index df7a5c5a04..f941c59d9f 100644 --- a/src/client/app/mobile/views/components/post-form.vue +++ b/src/client/app/mobile/views/components/post-form.vue @@ -102,6 +102,7 @@ export default Vue.extend({ geo: null, visibility: this.$store.state.settings.rememberNoteVisibility ? (this.$store.state.device.visibility || this.$store.state.settings.defaultNoteVisibility) : this.$store.state.settings.defaultNoteVisibility, visibleUsers: [], + localOnly: false, useCw: false, cw: null, recentHashtags: JSON.parse(localStorage.getItem('hashtags') || '[]'), @@ -274,7 +275,14 @@ export default Vue.extend({ compact: true }); w.$once('chosen', v => { - this.visibility = v; + const m = v.match(/^local-(.+)/); + if (m) { + this.localOnly = true; + this.visibility = m[1]; + } else { + this.localOnly = false; + this.visibility = v; + } }); }, @@ -320,6 +328,7 @@ export default Vue.extend({ } : null, visibility: this.visibility, visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined, + localOnly: this.localOnly, viaMobile: viaMobile }).then(data => { this.$emit('posted'); -- cgit v1.2.3-freya