Class: View

View

new View(options)

Parameters:
Name Type Description
options Object Object containing the properties listed below
Properties:
Name Type Description
holder String jQuery selector, refers to the element this view should be appended to
tag String Refers to a riot tag
static Boolean Indicates whether this is a static View

Members

<static> defaults :Object

Default properties of Views, these may be overridden
Type:
  • Object
Properties:
Name Type Argument Default Description
holder String <optional>
'body' Default holder
static String <optional>
false Whether the view is static

<static> riot :riot

Riot object the View uses, this should be used to run compiles, mounts etc. It may be overridden, but this should only done before any View is constructed.
Type:
  • riot

<static> staticViews :Object

All static Views will be put on here using their name as the key
Type:
  • Object

$el :jQuery|null

The root element wrapped in jQuery
Type:
  • jQuery | null

$holder :jQuery

The holder wrapped in jQuery
Type:
  • jQuery

el :HTMLElement|null

The root element of this view
Type:
  • HTMLElement | null

Methods

hide()

Hides the View

hide()

Removes the View

render(data)

Renders the riot tag to the DOM (into the $holder)
Parameters:
Name Type Description
data Object Data to be made available to the riot tag

show()

Shows the View

sync(data)

Syncs data to the riot tag
Parameters:
Name Type Description
data Object Data for the riot tag, will be extended with the current data
Rik Hoffbauer 2015
Documentation generated by JSDoc 3.4.0 on 2015-12-03T14:54:22+01:00