mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Misc fixes (#9215)
* quick add assign tags * fix columns descriptions * fix changing language not taking effect immediately
This commit is contained in:
@@ -280,7 +280,7 @@ export default {
|
||||
} else {
|
||||
settings[`preferences.${preferenceType}.${subtype}`] = this.user.preferences[preferenceType][subtype];
|
||||
}
|
||||
this.$store.dispatch('user:set', settings);
|
||||
return this.$store.dispatch('user:set', settings);
|
||||
},
|
||||
hideHeader () {
|
||||
this.set('hideHeader');
|
||||
@@ -338,10 +338,10 @@ export default {
|
||||
// @TODO
|
||||
// Notification.text(response.data.data.message);
|
||||
},
|
||||
changeLanguage (e) {
|
||||
async changeLanguage (e) {
|
||||
const newLang = e.target.value;
|
||||
this.user.preferences.language = newLang;
|
||||
this.set('language');
|
||||
await this.set('language');
|
||||
window.location.href = '/';
|
||||
},
|
||||
async changeUser (attribute, updates) {
|
||||
|
||||
@@ -9,12 +9,13 @@
|
||||
:class="{active: activeFilters[type].label === filter.label}",
|
||||
@click="activateFilter(type, filter)",
|
||||
) {{ $t(filter.label) }}
|
||||
.tasks-list
|
||||
.tasks-list(ref="tasksWrapper")
|
||||
input.quick-add(
|
||||
v-if="isUser", :placeholder="quickAddPlaceholder",
|
||||
v-model="quickAddText", @keyup.enter="quickAdd",
|
||||
ref="quickAdd",
|
||||
)
|
||||
.sortable-tasks(ref="taskList", v-sortable='', @onsort='sorted')
|
||||
.sortable-tasks(ref="tasksList", v-sortable='', @onsort='sorted')
|
||||
task(
|
||||
v-for="task in taskList",
|
||||
:key="task.id", :task="task",
|
||||
@@ -380,6 +381,7 @@ export default {
|
||||
},
|
||||
quickAdd () {
|
||||
const task = taskDefaults({type: this.type, text: this.quickAddText});
|
||||
task.tags = this.selectedTags;
|
||||
this.quickAddText = null;
|
||||
this.createTask(task);
|
||||
},
|
||||
@@ -398,23 +400,24 @@ export default {
|
||||
},
|
||||
setColumnBackgroundVisibility () {
|
||||
this.$nextTick(() => {
|
||||
const taskListEl = this.$refs.taskList;
|
||||
const tasklistHeight = taskListEl.offsetHeight;
|
||||
let combinedTasksHeights = 0;
|
||||
Array.from(taskListEl.getElementsByClassName('task')).forEach(el => {
|
||||
combinedTasksHeights += el.offsetHeight;
|
||||
});
|
||||
|
||||
if (!this.$refs.columnBackground) return;
|
||||
|
||||
const rewardsList = taskListEl.getElementsByClassName('reward-items')[0];
|
||||
const tasksWrapperEl = this.$refs.tasksWrapper;
|
||||
|
||||
const tasksWrapperHeight = tasksWrapperEl.offsetHeight;
|
||||
const quickAddHeight = this.$refs.quickAdd ? this.$refs.quickAdd.offsetHeight : 0;
|
||||
const tasksListHeight = this.$refs.tasksList.offsetHeight;
|
||||
|
||||
let combinedTasksHeights = tasksListHeight + quickAddHeight;
|
||||
|
||||
const rewardsList = tasksWrapperEl.getElementsByClassName('reward-items')[0];
|
||||
if (rewardsList) {
|
||||
combinedTasksHeights += rewardsList.offsetHeight;
|
||||
}
|
||||
|
||||
const columnBackgroundStyle = this.$refs.columnBackground.style;
|
||||
|
||||
if (tasklistHeight - combinedTasksHeights < 150) {
|
||||
if (tasksWrapperHeight - combinedTasksHeights < 150) {
|
||||
columnBackgroundStyle.display = 'none';
|
||||
} else {
|
||||
columnBackgroundStyle.display = 'block';
|
||||
|
||||
Reference in New Issue
Block a user