Set different label width for desktop, tablet and mobile

This commit is contained in:
Angelina Filippova 2020-02-17 17:27:07 +03:00
parent e697d7eadf
commit 85ef1074ac
23 changed files with 220 additions and 25 deletions

View file

@ -10,7 +10,7 @@
</el-tooltip>
</div>
<el-divider class="divider"/>
<el-form label-width="180px" class="emoji-packs-form">
<el-form :label-width="labelWidth" class="emoji-packs-form">
<el-form-item :label="$t('emoji.localPacks')">
<el-button type="primary" @click="refreshLocalPacks">{{ $t('emoji.refreshLocalPacks') }}</el-button>
</el-form-item>
@ -71,8 +71,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '240px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '240px'
}
},
localPacks() {
return this.$store.state.emojiPacks.localPacks

View file

@ -35,8 +35,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.$store.state.settings.loading

View file

@ -43,8 +43,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
ldap() {
return this.settings.description.find(setting => setting.key === ':ldap')

View file

@ -31,8 +31,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -35,6 +35,9 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
kocaptcha() {
return this.settings.description.find(setting => setting.key === 'Pleroma.Captcha.Kocaptcha')
},
@ -42,7 +45,13 @@ export default {
return _.get(this.settings.settings, [':pleroma', 'Pleroma.Captcha.Kocaptcha']) || {}
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -31,8 +31,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -79,8 +79,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -31,8 +31,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -67,8 +67,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -92,7 +92,7 @@
<prune-input v-if="setting.key === ':prune'" :data="data[setting.key]" :setting-group="settingGroup" :setting="setting"/>
<rate-limit-input v-if="settingGroup.key === ':rate_limit'" :data="data" :setting-group="settingGroup" :setting="setting"/>
<!-------------------->
<el-tooltip v-if="canBeDeleted && isMobile" :content="$t('settings.removeFromDB')" placement="bottom-end" class="delete-setting-button-container">
<el-tooltip v-if="canBeDeleted && (isMobile || isTablet)" :content="$t('settings.removeFromDB')" placement="bottom-end" class="delete-setting-button-container">
<el-button icon="el-icon-delete" circle size="mini" class="delete-setting-button" @click="removeSetting"/>
</el-tooltip>
</div>
@ -210,8 +210,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
keywordData() {
return Array.isArray(this.data) ? this.data : []

View file

@ -65,8 +65,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -37,8 +37,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -49,8 +49,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -51,8 +51,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -40,8 +40,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.$store.state.settings.loading

View file

@ -25,8 +25,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -29,8 +29,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -32,8 +32,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -31,8 +31,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.$store.state.settings.loading

View file

@ -47,7 +47,7 @@
</span>
<span class="label-font">{{ setting.label }}</span>
</el-form-item>
<el-tooltip v-if="isMobile && canBeDeleted(setting.key)" :content="$t('settings.removeFromDB')" placement="bottom-end">
<el-tooltip v-if="canBeDeleted(setting.key) && (isMobile || isTablet)" :content="$t('settings.removeFromDB')" placement="bottom-end">
<el-button icon="el-icon-delete" circle size="mini" class="settings-delete-button" @click="removeSetting(setting.key)"/>
</el-tooltip>
</div>
@ -103,6 +103,9 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
loading() {
return this.$store.state.settings.loading
}

View file

@ -43,8 +43,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -25,8 +25,17 @@ export default {
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
},
labelWidth() {
return this.isMobile ? '120px' : '280px'
if (this.isMobile) {
return '120px'
} else if (this.isTablet) {
return '200px'
} else {
return '280px'
}
},
loading() {
return this.settings.loading

View file

@ -78,7 +78,7 @@
</el-tab-pane>
</el-tabs>
</div>
<div v-if="isMobile">
<div v-if="isMobile || isTablet">
<h1 class="settings-header">{{ $t('settings.settings') }}</h1>
<div class="settings-header-container">
<el-select v-model="activeTab" class="settings-menu" placeholder="Select">
@ -216,6 +216,9 @@ export default {
},
isMobile() {
return this.$store.state.app.device === 'mobile'
},
isTablet() {
return this.$store.state.app.device === 'tablet'
}
},
mounted: function() {