diff options
| author | shpuld <shp@cock.li> | 2019-01-31 17:00:31 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-01-31 17:00:31 +0200 |
| commit | 476bf0afe1c890b0f08587b3942981c8c591c7be (patch) | |
| tree | fcadf92a94d8e310355f640a69a92010eee002cb | |
| parent | fbe7af3d56e4e6e168208a511bd7cd4e4e4e7a40 (diff) | |
Fix media timeline attachments being small by adding an option to not render background tabs in tab switcher
| -rw-r--r-- | src/components/settings/settings.js | 2 | ||||
| -rw-r--r-- | src/components/style_switcher/style_switcher.js | 2 | ||||
| -rw-r--r-- | src/components/tab_switcher/tab_switcher.js (renamed from src/components/tab_switcher/tab_switcher.jsx) | 12 | ||||
| -rw-r--r-- | src/components/user_profile/user_profile.vue | 48 | ||||
| -rw-r--r-- | src/components/user_settings/user_settings.js | 2 | ||||
| -rw-r--r-- | src/components/user_settings/user_settings.vue | 2 |
6 files changed, 52 insertions, 16 deletions
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 06011e7c..7000fa5e 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -1,5 +1,5 @@ /* eslint-env browser */ -import TabSwitcher from '../tab_switcher/tab_switcher.jsx' +import TabSwitcher from '../tab_switcher/tab_switcher.js' import StyleSwitcher from '../style_switcher/style_switcher.vue' import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue' import { filter, trim } from 'lodash' diff --git a/src/components/style_switcher/style_switcher.js b/src/components/style_switcher/style_switcher.js index 6a4e1cba..8c3d4861 100644 --- a/src/components/style_switcher/style_switcher.js +++ b/src/components/style_switcher/style_switcher.js @@ -7,7 +7,7 @@ import OpacityInput from '../opacity_input/opacity_input.vue' import ShadowControl from '../shadow_control/shadow_control.vue' import FontControl from '../font_control/font_control.vue' import ContrastRatio from '../contrast_ratio/contrast_ratio.vue' -import TabSwitcher from '../tab_switcher/tab_switcher.jsx' +import TabSwitcher from '../tab_switcher/tab_switcher.js' import Preview from './preview.vue' import ExportImport from '../export_import/export_import.vue' diff --git a/src/components/tab_switcher/tab_switcher.jsx b/src/components/tab_switcher/tab_switcher.js index 9038733c..f9c3f927 100644 --- a/src/components/tab_switcher/tab_switcher.jsx +++ b/src/components/tab_switcher/tab_switcher.js @@ -4,6 +4,7 @@ import './tab_switcher.scss' export default Vue.component('tab-switcher', { name: 'TabSwitcher', + props: ['renderOnlyFocused'], data () { return { active: this.$slots.default.findIndex(_ => _.tag) @@ -44,11 +45,12 @@ export default Vue.component('tab-switcher', { const contents = this.$slots.default.map((slot, index) => { if (!slot.tag) return const active = index === this.active - return ( - <div class={active ? 'active' : 'hidden'}> - {slot} - </div> - ) + if (this.renderOnlyFocused) { + return active + ? <div class="active">{slot}</div> + : <div class="hidden"></div> + } + return <div class={active ? 'active' : 'hidden' }>{slot}</div> }) return ( diff --git a/src/components/user_profile/user_profile.vue b/src/components/user_profile/user_profile.vue index f9b964ce..e53ce4cc 100644 --- a/src/components/user_profile/user_profile.vue +++ b/src/components/user_profile/user_profile.vue @@ -1,12 +1,28 @@ <template> <div> <div v-if="user.id" class="user-profile panel panel-default"> - <user-card-content :user="user" :switcher="true" :selected="timeline.viewing"></user-card-content> - <tab-switcher> - <Timeline :label="$t('user_card.statuses')" :embedded="true" :title="$t('user_profile.timeline_title')" :timeline="timeline" :timeline-name="'user'" :user-id="fetchBy"/> + <user-card-content + :user="user" + :switcher="true" + :selected="timeline.viewing" + /> + <tab-switcher :renderOnlyFocused="true"> + <Timeline + :label="$t('user_card.statuses')" + :embedded="true" + :title="$t('user_profile.timeline_title')" + :timeline="timeline" + :timeline-name="'user'" + :user-id="fetchBy" + /> <div :label="$t('user_card.followees')"> <div v-if="friends"> - <user-card v-for="friend in friends" :key="friend.id" :user="friend" :showFollows="true"></user-card> + <user-card + v-for="friend in friends" + :key="friend.id" + :user="friend" + :showFollows="true" + /> </div> <div class="userlist-placeholder" v-else> <i class="icon-spin3 animate-spin"></i> @@ -14,14 +30,32 @@ </div> <div :label="$t('user_card.followers')"> <div v-if="followers"> - <user-card v-for="follower in followers" :key="follower.id" :user="follower" :showFollows="false"></user-card> + <user-card + v-for="follower in followers" + :key="follower.id" + :user="follower" + :showFollows="false" + /> </div> <div class="userlist-placeholder" v-else> <i class="icon-spin3 animate-spin"></i> </div> </div> - <Timeline :label="$t('user_card.media')" :embedded="true" :title="$t('user_card.media')" timeline-name="media" :timeline="media" :user-id="fetchBy" /> - <Timeline v-if="isUs" :label="$t('user_card.favorites')" :embedded="true" :title="$t('user_card.favorites')" timeline-name="favorites" :timeline="favorites"/> + <Timeline + :label="$t('user_card.media')" + :embedded="true" :title="$t('user_card.media')" + timeline-name="media" + :timeline="media" + :user-id="fetchBy" + /> + <Timeline + v-if="isUs" + :label="$t('user_card.favorites')" + :embedded="true" + :title="$t('user_card.favorites')" + timeline-name="favorites" + :timeline="favorites" + /> </tab-switcher> </div> <div v-else class="panel user-profile-placeholder"> diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index be799f5d..719a9c0c 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -1,4 +1,4 @@ -import TabSwitcher from '../tab_switcher/tab_switcher.jsx' +import TabSwitcher from '../tab_switcher/tab_switcher.js' import StyleSwitcher from '../style_switcher/style_switcher.vue' import fileSizeFormatService from '../../services/file_size_format/file_size_format.js' diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue index 253bbd34..993675ba 100644 --- a/src/components/user_settings/user_settings.vue +++ b/src/components/user_settings/user_settings.vue @@ -130,7 +130,7 @@ <div class="setting-item"> <h2>{{$t('settings.follow_import')}}</h2> <p>{{$t('settings.import_followers_from_a_csv_file')}}</p> - <form v-model="followImportForm"> + <form> <input type="file" ref="followlist" v-on:change="followListChange"></input> </form> <i class=" icon-spin4 animate-spin uploading" v-if="followListUploading"></i> |
