Set completed state

This commit is contained in:
Raimund Schlüßler 2018-11-09 08:37:51 +01:00
parent 765d913260
commit e5967d4dd5
No known key found for this signature in database
GPG key ID: 036FA7EB1A599178
2 changed files with 9 additions and 4 deletions

View file

@ -38,7 +38,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.
class="task-checkbox"
name="toggleCompleted"
role="checkbox"
@click="toggleCompleted(task.uri)">
@click="toggleCompleted(task)">
<span :class="{'icon-checkmark': task.completed}" class="icon task-checkbox reactive" />
</a>
<a class="icon task-separator" />

View file

@ -113,10 +113,15 @@ const mutations = {
* Toggles the completed state of a task
*
* @param {Object} state the store data
* @param {string} taskId The task id
* @param {string} task The task
*/
toggleCompleted(state, taskId) {
console.debug('Toggle completed state of task with uri ' + taskId)
toggleCompleted(state, task) {
if (task.completed) {
task.complete = 0
} else {
task.complete = 100
}
// TODO: set completed state of parent and child tasks
},
/**