suds/ views
A view implementation is a wrapper for a DOM node.
Table of Contents #
- parent
- element
- children
- animateInDelay
- animateOutDelay
- initialize()
- appendView()
- prependView()
- removeView()
- contains()
- parse()
- animateIn()
- executeAnimateIn()
- animateOut()
- executeAnimateOut()
parent #
Holds a reference to the parent view. parent
is null
if the view hasn't been added.
element #
Holds a reference to it's DOM node. This is the value passed to the constructor or a div if no element was passed.
See: initialize()
children #
childen
is an array of all it's subviews.
animateInDelay #
Represents the amount of milliseconds by which executeAnimateIn
is called after a call to animateIn
.
See: animateIn
, executeAnimateIn
animateOutDelay #
See animateInDelay
initialize( [node : Object = jQuery] ) : View #
The contsructor can be called with one argument which will be used as the DOM node for this view. If no argument is supplied a DIV will be created.
var view = new View(); document.body.appendChild( view.element ); var sub = new View( $( "a" ) ); view.appendView( sub );
appendView( view : View ) : void #
Appends the DOM node of the passed view
and sets it's parent
attribute. appending views allows for event bubbling and animateIn
and animateOut
calls to be called recursively through out the DOM tree.
See: prependView()
prependView( view : View ) : void #
Same as appendView
but it adds the view as it's first child.
removeView( view : View ) #
Removes the view from it's children and removes it's node from the DOM
contains( view : View ) : Boolean #
Checks if the supplied view
is it's child.
parse( template : String, values : Object ) : String #
parse
can be used for simple templating that uses a simple replace-algorithm.
animateIn() : void #
This method is used for recursive calls. It calls executeAnimateIn
with the provided delay animateInDelay
in milliseconds.
animateIn
should be called in order to trigger executeAnimateIn
function of the view and all it's subviews.
See: executeAnimateIn
executeAnimateIn() : void #
This method should be overridden to create animations. It will be called within the given delay.
In order to call all sub views, make sure to call this._super()
when overriding this method.
executeAnimateIn: function() { this._super(); this.wings.spread(); }
animateOut() : void #
Same as animateIn
.
See: animateIn()
executeAnimateOut() : void #
Same as executeAnimateIn
.
See: executeAnimateIn()
Documentation generated by mdoc.