Sha256: f4f3e936ee2e4edba63d5deb35311075c86ac13e3ce1c0bea419ae409f7a9b74

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

    /**
    @@alias Part
    @@to Mask.CompositeMask.Part
    **/
    var Part = Mask.CompositeMask.Part;

    /**
    An object holding positioning information for the mask part

    @@field position
    @type Object
    **/
    Part.field("position", {});

    /**
    An object holding dimension information for the mask part

    @@field position
    @type Object
    **/
    Part.field("dimension", {});

    /**
    Renders the mask part

    @method render
    **/
    Part.method("render", function() {
        this.$el = $("<div>")
            .addClass("sideshow-mask-part")
            .addClass("sideshow-hidden")
            .addClass("sideshow-invisible");
        this.callSuper("render");
    });

    /**
    Updates the dimension and positioning of the subject mask part

    @method update
    @param {Object} position                              The positioning information 
    @param {Object} dimension                             The dimension information 
    **/
    Part.method("update", function(position, dimension) {
        this.position = position;
        this.dimension = dimension;
        this.$el
            .css("left", position.x)
            .css("top", position.y)
            .css("width", dimension.width)
            .css("height", dimension.height);
    });

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sideshow-0.4.2 src/mask/composite_mask_part.js
sideshow-0.4.1 src/mask/composite_mask_part.js