Set completed state
This commit is contained in:
parent
765d913260
commit
e5967d4dd5
2 changed files with 9 additions and 4 deletions
|
@ -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" />
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue