Class: View

View

new tart.components.Carousel.View()

Extends

Members

domElement

protecteddomCache

templateClass

Methods

buildCarouselItems(itemArray)

Build carousel items from item array

Name Type Description
itemArray Array.<Object>

carousel data array.

Name Type Description
pager tart.base.plugin.Pager

to build pager.

Clears the view's dom cache. This might come in handy where you find yourself with dangling HTMLElement's who are not in DOM anymore but bugs you because they are in cache. This also helps with memory leaks; you should often clear your cache. TODO: Make this default with a deconstructor for view

Get item, which is indicated on domMappings node Cache them to domCache and return item Example of usage with an id as selector: this.get("[id='elementId']") or this.get("[id=elementId]")

Name Type Description
key string

Object key from domMappings node.

Returns:
Type Description
Object found object after traverse.

protectedgetAllCarouselItemsDomReference(){Object}

get all carousel items' DOM reference

Returns:
Type Description
Object DOM refernce.

inherited getDOM(){Element}

get current DOM reference

Returns:
Type Description
Element

handleNavigationButtons(hasNext, hasPrev)

Name Type Description
hasNext boolean

Whether there is a previous page.

hasPrev boolean

Whether there is a next page.

Method to hide previous button.

move(direction, diff, moveCount)

Animate carousel with given rule

Name Type Description
direction string

'next' or 'previous' TODO: this should be enumarated.

diff Array.<Object>

items to be inserted.

moveCount number

count of move.

No results handler

Render method which has to be overriden

Returns:
Type Description
string markup.

Sets base DOM tree for component

Name Type Description
dom Element

base DOM reference for component.

setPageSelected(pageNum)

Name Type Description
pageNum number

number of selected page.