Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/tasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/store/tasks.js')
-rw-r--r--src/store/tasks.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/store/tasks.js b/src/store/tasks.js
index 6458dc13..9e7c807e 100644
--- a/src/store/tasks.js
+++ b/src/store/tasks.js
@@ -463,6 +463,17 @@ const mutations = {
},
/**
+ * Sets the sort order of a task
+ *
+ * @param {Object} state The store data
+ * @param {Task} task The task
+ * @param {Integer} order The sort order
+ */
+ setSortOrder(state, { task, order }) {
+ Vue.set(task, 'sortOrder', order)
+ },
+
+ /**
* Sets the due date of a task
*
* @param {Object} state The store data
@@ -1057,6 +1068,21 @@ const actions = {
},
/**
+ * Sets the sort order of a task
+ *
+ * @param {Object} context The store context
+ * @param {Task} task The task to update
+ * @param {Integer} order The sort order
+ */
+ async setSortOrder(context, { task, order }) {
+ if (task.sortOrder === order) {
+ return
+ }
+ context.commit('setSortOrder', { task, order })
+ context.dispatch('scheduleTaskUpdate', task)
+ },
+
+ /**
* Sets the due date of a task
*
* @param {Object} context The store context