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
-
templateObject herited of Template.defaultTemplate => " - <input class="toggle" type="checkbox" {{checked}}> {{title}}"
-
ENTER_KEYnumber keyboard for validate new TODO -
ESCAPE_KEYnumber keyboard for escape -
$todoListArray select all the items with the "todo-list" class -
$todoListArray select all the items with the "todo-list" class -
$todoListArray select all the items with the "todo-list" class -
$todoItemCounterArray select all the items with the "todo-count" class -
$clearCompletedArray select all the items with the "clear-completed" class -
$mainArray select all the items with the "main" class -
$footerArray select all the items with the "footer" class -
$toggleAllArray select all the items with the "toggle-all" class -
$newTodoArray select all the items with the "new-todo" class
select a TODO with his id and remove it from the DOM
-
idstring id off the element targeted withe this remove event
-
completedCountnumber number of items how are completed -
visibleboolean apply display style "visible" or "block"
-
currentPagestring '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
-
viewCmdFunction parameter for apply the select method parameter
manage the context (bind() methode)
eventhandler
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