From 49a4b4e77d33f7f12bb6d20648f653839adc5b9e Mon Sep 17 00:00:00 2001 From: Gbaja Date: Fri, 3 Nov 2017 12:33:24 +0000 Subject: [PATCH] Added features to make web app more accessible relates to #33 removed console.log's relates to #39 --- dom.js | 11 ++--------- index.html | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/dom.js b/dom.js index f4832ca..ad31322 100644 --- a/dom.js +++ b/dom.js @@ -31,6 +31,7 @@ // deleteButtonNode.appendChild(deleteButtonText); todoNode.appendChild(deleteButtonNode); deleteButtonNode.setAttribute("class", "todo__List__button--del") + deleteButtonNode.setAttribute('aria-label','Delete button'); deleteButtonNode.addEventListener('click', function(event) { var newState = todoFunctions.deleteTodo(state, todo.id); update(newState); @@ -40,9 +41,9 @@ // add markTodo button var markTodoButton = document.createElement('button'); markTodoButton.innerHTML = ''; - // markTodoButton.appendChild(markTodoButtonText); todoNode.appendChild(markTodoButton) markTodoButton.setAttribute("class", "todo__List__button--mark") + markTodoButton.setAttribute('aria-label','Complete button'); // add classes for css markTodoButton.addEventListener('click', function(event){ var newState = todoFunctions.markTodo(state, todo.id); @@ -53,7 +54,6 @@ todoText.classList.remove("completed"); todo.done = false; } - console.log(todo.done) }) return todoNode; }; @@ -73,14 +73,9 @@ return 0; sortButton.addEventListener('click', function(event) { var newState = todoFunctions.sortTodos(state,sortOrder); - console.log(newState); update(newState); - // deleteButtonNode.addEventListener('click', function(event) { - // var newState = todoFunctions.deleteTodo(state, todo.id); - // update(newState); - }); @@ -91,7 +86,6 @@ return 0; // what does event.preventDefault do? // what is inside event.target? event.preventDefault(); - console.log(event.target[0].value); var newdescription = event.target[0].value; @@ -104,7 +98,6 @@ return 0; // hint: todoFunctions.addTodo var newState = todoFunctions.addTodo(state, newObj); // ?? change this! update(newState); - console.log(state) document.getElementsByClassName("todoform__input")[0].value = ''; }); diff --git a/index.html b/index.html index 52be166..c591b4b 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@

To Do