What does rootmodifers do in famo.us?

45 views Asked by At

I am new to Famo.us, can anybody explain me what does rootmodifers do in famo.us, here is its example

function SlideshowView () {
    Views.apply(this, arguments);
    this.rootModifier = new StateModifier({
        size:this.options.size
    });
    this.mainNode = this.add(this.rootModifier);
    _createLightBox.call(this);
    _createSlides.call(this);

}
1

There are 1 answers

0
Subtubes On

this.rootMidifier just allows you to have a way to control the entire slideShow's position, opacity, origin, or alignment later in the applications. More importantly this.rootModifier is added to the render node like this this.mainNode = this.add(this.rootModifier); This code places the modifier at the top of the render tree for the slideshow branch and exposes access to the modifier for later use in the all. For example later in the app you could have a function that changes the opacity.

SlideShow.prototype.hide = function() {

  this.rootModifier.setOpacity(0, {duration: 3000});
}