View - RomainValy/ToDoMVC-OpenclassRoom-project GitHub Wiki
global qs, qsa, $on, $parent, $delegate
Extends Template
View that abstracts away the browser's DOM completely. It has two simple entry points:
- bind(eventName, handler) Takes a todo application event and registers the handler
- render(command, parameterObject) Renders the given command with the options
-
template
Object herited of Template.defaultTemplate => " - <input class="toggle" type="checkbox" {{checked}}> {{title}}"
-
ENTER_KEY
number keyboard for validate new TODO -
ESCAPE_KEY
number keyboard for escape -
$todoList
Array select all the items with the "todo-list" class -
$todoList
Array select all the items with the "todo-list" class -
$todoList
Array select all the items with the "todo-list" class -
$todoItemCounter
Array select all the items with the "todo-count" class -
$clearCompleted
Array select all the items with the "clear-completed" class -
$main
Array select all the items with the "main" class -
$footer
Array select all the items with the "footer" class -
$toggleAll
Array select all the items with the "toggle-all" class -
$newTodo
Array select all the items with the "new-todo" class
select a TODO with his id and remove it from the DOM
-
id
string id off the element targeted withe this remove event
-
completedCount
number number of items how are completed -
visible
boolean apply display style "visible" or "block"
-
currentPage
string 'all' | 'active' | 'completed'
Can change a value of a todo in the list
Validate the itm modify with View.prototype._editItem
centralise all the method of the View class
-
viewCmd
Function parameter for apply the select method parameter
manage the context (bind() methode)
event
handler
In case it was toggled from an event and not by clicking the checkbox
Remove the cursor from the input when you hit enter just like if it were a real form