diff options
| author | Eris <femmediscord@gmail.com> | 2021-06-14 17:54:40 +0000 |
|---|---|---|
| committer | Eris <femmediscord@gmail.com> | 2021-06-14 17:54:40 +0000 |
| commit | adfe56a3a31b3c4a8c2c206c06bebf9c4af675d1 (patch) | |
| tree | 552897a6324f91d193efca382a382ab9ad2bcb98 /src | |
| parent | 2725a0c6398a876590b458ff1a8d6c2cc9af1d11 (diff) | |
New option: Always show floating New Post button
Diffstat (limited to 'src')
| -rw-r--r-- | src/App.js | 3 | ||||
| -rw-r--r-- | src/App.vue | 1 | ||||
| -rw-r--r-- | src/components/mobile_post_status_button/mobile_post_status_button.js | 3 | ||||
| -rw-r--r-- | src/components/mobile_post_status_button/mobile_post_status_button.vue | 4 | ||||
| -rw-r--r-- | src/components/settings_modal/tabs/general_tab.vue | 5 | ||||
| -rw-r--r-- | src/components/shout_panel/shout_panel.vue | 9 | ||||
| -rw-r--r-- | src/i18n/en.json | 1 | ||||
| -rw-r--r-- | src/modules/config.js | 1 |
8 files changed, 24 insertions, 3 deletions
@@ -73,6 +73,9 @@ export default { this.$store.state.instance.instanceSpecificPanelContent }, showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel }, + shoutboxPosition () { + return this.$store.getters.mergedConfig.showNewPostButton || false + }, isMobileLayout () { return this.$store.state.interface.mobileLayout }, privateMode () { return this.$store.state.instance.private }, sidebarAlign () { diff --git a/src/App.vue b/src/App.vue index 6c582c03..6b867498 100644 --- a/src/App.vue +++ b/src/App.vue @@ -53,6 +53,7 @@ v-if="currentUser && shout" :floating="true" class="floating-shout mobile-hidden" + :class="{ 'left': shoutboxPosition }" /> <MobilePostStatusButton /> <UserReportingModal /> diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.js b/src/components/mobile_post_status_button/mobile_post_status_button.js index 366ea89c..d27fb3b8 100644 --- a/src/components/mobile_post_status_button/mobile_post_status_button.js +++ b/src/components/mobile_post_status_button/mobile_post_status_button.js @@ -44,6 +44,9 @@ const MobilePostStatusButton = { return this.autohideFloatingPostButton && (this.hidden || this.inputActive) }, + isPersistent () { + return !!this.$store.getters.mergedConfig.showNewPostButton + }, autohideFloatingPostButton () { return !!this.$store.getters.mergedConfig.autohideFloatingPostButton } diff --git a/src/components/mobile_post_status_button/mobile_post_status_button.vue b/src/components/mobile_post_status_button/mobile_post_status_button.vue index 767f8244..37becf4c 100644 --- a/src/components/mobile_post_status_button/mobile_post_status_button.vue +++ b/src/components/mobile_post_status_button/mobile_post_status_button.vue @@ -2,7 +2,7 @@ <div v-if="isLoggedIn"> <button class="button-default new-status-button" - :class="{ 'hidden': isHidden }" + :class="{ 'hidden': isHidden, 'always-show': isPersistent }" @click="openPostForm" > <FAIcon icon="pen" /> @@ -47,7 +47,7 @@ } @media all and (min-width: 801px) { - .new-status-button { + .new-status-button:not(.always-show) { display: none; } } diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index bdb29edf..4c09d047 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -118,6 +118,11 @@ </BooleanSetting> </li> <li> + <BooleanSetting path="showNewPostButton"> + {{ $t('settings.showPostButton') }} + </BooleanSetting> + </li> + <li> <BooleanSetting path="autohideFloatingPostButton"> {{ $t('settings.autohide_floating_post_button') }} </BooleanSetting> diff --git a/src/components/shout_panel/shout_panel.vue b/src/components/shout_panel/shout_panel.vue index f90baf80..c88797d1 100644 --- a/src/components/shout_panel/shout_panel.vue +++ b/src/components/shout_panel/shout_panel.vue @@ -79,12 +79,19 @@ .floating-shout { position: fixed; - right: 0px; bottom: 0px; z-index: 1000; max-width: 25em; } +.floating-shout.left { + left: 0px; +} + +.floating-shout:not(.left) { + right: 0px; +} + .shout-panel { .shout-heading { cursor: pointer; diff --git a/src/i18n/en.json b/src/i18n/en.json index aa440ac1..26f51cea 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -349,6 +349,7 @@ "max_thumbnails": "Maximum amount of thumbnails per post", "hide_isp": "Hide instance-specific panel", "right_sidebar": "Show sidebar on the right side", + "showPostButton": "Always show floating New Post button", "hide_wallpaper": "Hide instance wallpaper", "preload_images": "Preload images", "use_one_click_nsfw": "Open NSFW attachments with just one click", diff --git a/src/modules/config.js b/src/modules/config.js index 0f596750..30c77a7b 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -34,6 +34,7 @@ export const defaultState = { loopVideoSilentOnly: true, streaming: false, emojiReactionsOnTimeline: true, + showNewPostButton: false, autohideFloatingPostButton: false, pauseOnUnfocused: true, stopGifs: false, |
