-
Notifications
You must be signed in to change notification settings - Fork 9
Vladimir Kulikov #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,20 @@ | |||
h1, h2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that all h1, h2 on your page should have the same margin? It's better to add class and create css rule for class
padding: 20px 0; | ||
} | ||
|
||
select { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with previous. Select should have class
<label for="task">Task</label> | ||
<input type="text" class="add-task-text form-control" id="task" aria-describedby="taskHelp" | ||
placeholder="What should be done?"> | ||
<div class="invalid-feedback"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add additional functionality, it has to work. There isn't a requirement for any validation in the task description. It's a good idea to prohibit adding an empty task. But it doesn't work. I'm able to add an empty task
<tr> | ||
<th scope="col">Task</th> | ||
<th scope="col">Deadline</th> | ||
<th scope="col"></th> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's strange that the column doesn't have a name. You can call it 'Actions' or something like this
}; | ||
|
||
var run = function () { | ||
if (!localStorage.getItem('todoList')) localStorage.setItem('todoList', "[]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's better to write like this (even when you have only one action):
if (...) {
...
}
|
||
var removeTaskBtns = document.querySelectorAll(DOMSelectors.removeTaskBtns); | ||
removeTaskBtns.forEach(function (btn) { | ||
btn.addEventListener('click', removeTask); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just add a listener for the delete button when you create a new task. It'll work faster
|
||
var completeTaskBtns = document.querySelectorAll(DOMSelectors.completeTaskBtns); | ||
completeTaskBtns.forEach(function (btn) { | ||
btn.addEventListener('click', completeTask); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with delete button
|
||
var filters = document.querySelectorAll(DOMSelectors.filters); | ||
filters.forEach(function (filter) { | ||
filter.addEventListener('change', render); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same with the button Add task
saveTasks(tasks); | ||
task.value = ""; | ||
deadline.value = ""; | ||
render(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You definitely don't need to rerender existed tasks, they haven't been changed for sure.
Here you should add a new task and listener on complete and delete.
return task; | ||
}); | ||
saveTasks(updatedTasks); | ||
render(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here also only one task has been changed
No description provided.