File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,13 @@ <h1>Goal</h1>
209209const node = document . createElement ( "li" ) ;
210210const text = document . createTextNode ( todo . name ) ;
211211
212- node . appendChild ( text ) ;
212+ node . appendChild ( text ) ;
213+
214+ node . style . textDecoration = todo . complete ? "line-through" : "none" ;
215+
216+ node . addEventListener ( "click" , ( ) => {
217+ store . dispatch ( toggleTodoAction ( todo . id ) ) ;
218+ } ) ;
213219
214220document . getElementById ( "todos" ) . appendChild ( node ) ;
215221}
@@ -220,6 +226,12 @@ <h1>Goal</h1>
220226
221227node . appendChild ( text ) ;
222228
229+ node . style . textDecoration = todo . complete ? "line-through" : "none" ;
230+
231+ node . addEventListener ( "click" , ( ) => {
232+ store . dispatch ( toggleTodoAction ( goal . id ) ) ;
233+ } ) ;
234+
223235document . getElementById ( "goals" ) . appendChild ( node ) ;
224236}
225237</ script >
You can’t perform that action at this time.
0 commit comments