mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Sept 14 2017 (#9037)
* Added new message count * Added route change for group plan * Added fix for quest value of 0 * Fixed guild summary limit, guild and challenge height * Added task sorting * Added api buy armoire * Fixed linting
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
:class="{active: activeFilter.label === filter.label}",
|
||||
@click="activateFilter(type, filter)",
|
||||
) {{ $t(filter.label) }}
|
||||
.tasks-list(ref="taskList")
|
||||
.tasks-list(ref="taskList", v-sortable='', @onsort='sorted')
|
||||
task(
|
||||
v-for="task in taskList",
|
||||
:key="task.id", :task="task",
|
||||
@@ -171,6 +171,7 @@ import rewardIcon from 'assets/svg/reward.svg';
|
||||
import bModal from 'bootstrap-vue/lib/components/modal';
|
||||
import shopItem from '../shops/shopItem';
|
||||
import throttle from 'lodash/throttle';
|
||||
import sortable from 'client/directives/sortable.directive';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -178,6 +179,9 @@ export default {
|
||||
bModal,
|
||||
shopItem,
|
||||
},
|
||||
directives: {
|
||||
sortable,
|
||||
},
|
||||
props: ['type', 'isUser', 'searchText', 'selectedTags', 'taskListOverride', 'group'], // @TODO: maybe we should store the group on state?
|
||||
data () {
|
||||
const types = Object.freeze({
|
||||
@@ -268,6 +272,20 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
...mapActions({loadCompletedTodos: 'tasks:fetchCompletedTodos'}),
|
||||
sorted (data) {
|
||||
const sorting = this.taskList;
|
||||
const taskIdToMove = this.taskList[data.oldIndex]._id;
|
||||
|
||||
if (sorting) {
|
||||
const deleted = sorting.splice(data.oldIndex, 1);
|
||||
sorting.splice(data.newIndex, 0, deleted[0]);
|
||||
}
|
||||
|
||||
this.$store.dispatch('tasks:move', {
|
||||
taskId: taskIdToMove,
|
||||
position: data.newIndex,
|
||||
});
|
||||
},
|
||||
editTask (task) {
|
||||
this.$emit('editTask', task);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user