Skip to content

Commit

Permalink
Added features to make web app more accessible
Browse files Browse the repository at this point in the history
relates to #33
removed console.log's
relates to #39
  • Loading branch information
Gbaja committed Nov 3, 2017
1 parent 5ff57fc commit 49a4b4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -40,9 +41,9 @@
// add markTodo button
var markTodoButton = document.createElement('button');
markTodoButton.innerHTML = '<i class="fa fa-check" aria-hidden="true"></i>';
// 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);
Expand All @@ -53,7 +54,6 @@
todoText.classList.remove("completed");
todo.done = false;
}
console.log(todo.done)
})
return todoNode;
};
Expand All @@ -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);

});


Expand All @@ -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;


Expand All @@ -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 = '';

});
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1 class="container__header">To Do</h1>
</ul>
</div>
<footer class="footer">
<button class="sort" id="sortId">Sort</button>
<button aria-label="sort todo's button" class="sort" id="sortId">Sort</button>
</footer>
</div>

Expand Down

0 comments on commit 49a4b4e

Please sign in to comment.