This repository was archived by the owner on Jan 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 11## VueJS Task Manager
2- Version 0 .0.1
2+ Version 1 .0.0
33
44Trello inspired task manager written in JavaScript using the VueJS framework.
55
66![ Task Manager] ( screenshot.png?raw=true " Task Manager ")
77
8- ### Work in progress (WIP) :
8+ ### Possible future Additions :
99* Task input focus open, and close on unfocus.
10- * Unfocus on category create.
11- * Possibly add completion feature.
10+ * Unfocus on category create.
Original file line number Diff line number Diff line change @@ -30,7 +30,10 @@ <h3 class="category-name">{{ cat.name }}</h3>
3030 </ li >
3131 < li v-for ="(task, taskIndex) in cat.tasks " class ="task-list-item ">
3232 < div class ="delete-icon task-delete-icon " v-on:click ="showModal(taskIndex, 'task-delete', index) "> X</ div >
33- < p v-bind:class ="{'task-complete': task.complete} "> {{ task.text }}</ p >
33+
34+ < p v-bind:class ="{'task-complete': task.complete} " v-on:click ="toggleCompletion(taskIndex, index, task.complete) ">
35+ {{ task.text }}
36+ </ p >
3437
3538 < div class ="clear "> </ div >
3639 </ li >
Original file line number Diff line number Diff line change @@ -98,6 +98,16 @@ var app = new Vue({
9898 this . categories [ data . parentIndex ] . tasks . splice ( data . index , 1 ) ;
9999 this . updateAppStorage ( ) ;
100100 } ,
101+ toggleCompletion : function ( taskIndex , index , complete ) {
102+ // Default false
103+ var updatedStatus = 0 ;
104+ // Switch val if necessary (!= false/updatedStatus)
105+ if ( ! complete ) updatedStatus = 1 ;
106+
107+ // Update data & update local storage
108+ this . categories [ index ] . tasks [ taskIndex ] . complete = updatedStatus ;
109+ this . updateAppStorage ( ) ;
110+ } ,
101111 updateAppStorage : function ( ) {
102112 // Check if this.categories isn't empty
103113 if ( this . categories . length ) {
You can’t perform that action at this time.
0 commit comments