Class: View

View()

new View()

Sets the default values for Template.
Source:

Methods

_bindItemEditCancel(handler)

EventListener of the cancelling of the element's editing.
Parameters:
Name Type Description
handler function Callback executed over certains contitions.
Source:

_bindItemEditDone(handler)

EventListener of the validation of the element's editing.
Parameters:
Name Type Description
handler function Callback executed over certains contitions.
Source:

_clearCompletedButton(completedCount, visible)

Hide completed items.
Parameters:
Name Type Description
completedCount number The number of checked items.
visible bolean True if visible, false otherwise.
Source:

_editItem(id, title)

Allows editing of an item.
Parameters:
Name Type Description
id number The ID of the item to edit.
title string The content of the item's modifications.
Source:

_editItemDone(id, title)

Replaces the old item by the edited item.
Parameters:
Name Type Description
id number The ID of the item to edit.
title string The content of the item's modifications.
Source:

_elementComplete(id, completed)

Test if the item is checked.
Parameters:
Name Type Description
id number ID of the item to test.
completed bolean The status of the item.
Source:

_itemId(element)

Adds an ID to the element.
Parameters:
Name Type Description
element object The active element.
Source:

_removeItem(id)

Delete the todo according to his id.
Parameters:
Name Type Description
id number The ID of the element to delete.
Source:

_setFilter(currentPage)

Indicates the current page.
Parameters:
Name Type Description
currentPage string The current page can have the values : '' || active || completed
Source:

bind(event, handler)

Make the link between the controller's methods and the view's elements.
Parameters:
Name Type Description
event function The active event.
handler function Callback executed over certains contitions.
Source:

render(viewCmd, parameter)

Return the elements in the DOM.
Parameters:
Name Type Description
viewCmd string The active function.
parameter object The active parameters.
Source: