ContentAreaViewModel (Class)

Summary

Location

Used across all instances a hash to cache attribute names and their getter
and setter names.

selectedItem

The model for the selected content.

value

The value of the content area property.

Methods

_changeAttrValue ( name , value
)

Internal helper for directly changing an attribute value.

Parameters

Name

Summary

Type

Usage

name

The property to set.

String

required

value

The value to set in the property.

Mixed

required

_createGroup ( name
)

Creates the group with the given name and adds it to the groups map.

Parameters

Name

Summary

Type

Usage

name

undefined

required

_emitChildrenChanged ( sender
)

Emits children changed event

Parameters

Name

Summary

Type

Usage

sender

The sender

Object

optional

_get ( name , names
)

Private function that does a get based off a hash of names

Parameters

Name

Summary

Type

Usage

name

undefined

required

names

Hash of names of custom attributes

undefined

required

_hash ( child
)

Creates a hash for the given child.

Parameters

Name

Summary

Type

Usage

child

undefined

required

_readOnlySetter ( readOnly
)

Parameters

Name

Summary

Type

Usage

readOnly

undefined

required

_selectedItemSetter ( value
)

Parameters

Name

Summary

Type

Usage

value

undefined

required

_transformValueToModels ( value
)

Transforms the current value into a tree representation using observable stores.

Parameters

Name

Summary

Type

Usage

value

undefined

required

_valueGetter ( )

_valueSetter ( value
)

Parameters

Name

Summary

Type

Usage

value

undefined

required

addChild ( child , index
)

Adds a child to the view model at the given index or at the end of the collection.

Parameters

Name

Summary

Type

Usage

child

The child to be added.

Object

required

index

The index where to the child will be inserted.

Number

optional

constructor ( )

destroy ( preserveDom
)

Destroy this class, releasing any resources registered via own().

Parameters

Name

Summary

Type

Usage

preserveDom

Boolean

required

emit ( type , event
)

Parameters

Name

Summary

Type

Usage

type

undefined

required

event

undefined

required

get ( name
)

Get a property on a Stateful instance.

Parameters

Name

Summary

Type

Usage

name

The property to get.

String

required

getChild ( item
)

Get the first child whose properties match the properties on the given item.

Parameters

Name

Summary

Type

Usage

item

undefined

required

getChildById ( id
)

Parameters

Name

Summary

Type

Usage

id

undefined

required

getChildren ( )

Get the children of the view model.

indexOf ( child
)

Returns the index of the child in the list of children

Parameters

Name

Summary

Type

Usage

child

The child to find the index for

Object

required

modify ( callback , scope , emitChanged
)

Method used to wrap several changes in one "operation"
When the callback has been executed the "changed" event will be emitted

Parameters

Name

Summary

Type

Usage

callback

Function to execute

function

required

scope

The scope that the callback should be executed in

Object

optional

emitChanged

Whether the "changed" event should be emitted after the changes have been applied.
Default is true.

Boolean

optional

move ( child , index
)

Moves the child to a specific index

Parameters

Name

Summary

Type

Usage

child

The child to be moved.

Object

required

index

The index where to the child will be moved to.

Number

required

moveOutsideGroup ( child
)

Move the child out from the group

Parameters

Name

Summary

Type

Usage

child

The child to move

Object

required

moveVisible ( child , moveToNext
)

Moves the child to a specific index based on visiblity of children.

Parameters

Name

Summary

Type

Usage

child

undefined

required

moveToNext

undefined

required

on ( type , listener
)

Parameters

Name

Summary

Type

Usage

type

undefined

required

listener

undefined

required

own ( )

Track specified handles and remove/destroy them when this instance is destroyed, unless they were
already removed/destroyed manually.

personalize ( child
)

Personalizes the child

Parameters

Name

Summary

Type

Usage

child

The block to personalize

epi-cms/contentediting/viewmodel/ContentBlockViewModel

required

postscript ( params
)

Parameters

Name

Summary

Type

Usage

params

Object

optional

removeChild ( child , recursive
)

Remove a child from the view model.

Parameters

Name

Summary

Type

Usage

child

undefined

required

recursive

undefined

required

set ( name , value
)

Set a property on a Stateful instance

Parameters

Name

Summary

Type

Usage

name

The property to set.

String

required

value

The value to set in the property.

Object

required

watch ( name , callback
)

Watches a property for changes

Parameters

Name

Summary

Type

Usage

name

Indicates the property to watch. This is optional (the callback may be the
only parameter), and if omitted, all the properties will be watched

String

optional

callback

The function to execute when the property changes. This will be called after
the property has been changed. The callback will be called with the |this|
set to the instance, the first argument as the name of the property, the
second argument as the old value and the third argument as the new value.