mfq
mfq

Reputation: 1377

What does rootmodifers do in famo.us?

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);

}

Upvotes: 1

Views: 44

Answers (1)

Subtubes
Subtubes

Reputation: 16913

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});
}

Upvotes: 1

Related Questions