View - RomainValy/ToDoMVC-OpenclassRoom-project GitHub Wiki

Table of Contents

window

global qs, qsa, $on, $parent, $delegate

View

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

Parameters

  • template Object herited of Template.defaultTemplate => "
  • <input class="toggle" type="checkbox" {{checked}}> {{title}}
  • "

template

Parameters

  • 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

_removeItem

select a TODO with his id and remove it from the DOM

Parameters

  • id string id off the element targeted withe this remove event

_clearCompletedButton

Parameters

  • completedCount number number of items how are completed
  • visible boolean apply display style "visible" or "block"

_setFilter

Parameters

  • currentPage string 'all' | 'active' | 'completed'

_elementComplete

Parameters

_editItem

Can change a value of a todo in the list

Parameters

_editItemDone

Validate the itm modify with View.prototype._editItem

Parameters

render

centralise all the method of the View class

Parameters

  • viewCmd Function parameter for apply the select method
  • parameter

bind

manage the context (bind() methode)

Parameters

  • event
  • handler

checked

In case it was toggled from an event and not by clicking the checkbox

self

blur

Remove the cursor from the input when you hit enter just like if it were a real form

⚠️ **GitHub.com Fallback** ⚠️