/// class ProspectDirector.Web.UI.FeatureSets.Layouts.SimpleLayoutDOM

/**
@class SimpleLayoutDOM
@namespace Web.UI.FeatureSets.Layouts
@constructor
@extends Web.UI.FeatureSets.Layouts.LayoutDOM
**/
ProspectDirector.Web.UI.FeatureSets.Layouts.SimpleLayoutDOM =
ProspectDirector.Web.UI.FeatureSets.Layouts.LayoutDOM.extend({

    //================================
    // CONSTRUCTOR
    //================================

    init: function (options) {
        this._super(options);
    },

    //================================
    // PUBLIC METHODS
    //================================

    get_contentNode: function () {
        return this.get_containerNode().find(".-pd-fs-layout-simple-content");
    },

    //================================
    // PUBLIC METHODS
    //================================

    applyAssemblerSelection: function (id) {

        var assemblerNode = this.get_contentNode().children("[data-id=" + id + "]");

        assemblerNode.css({
            visibility: "visible"
        });

    },

    clearAssemblerSelections: function (id) {

        var assemblerNode = this.get_contentNode().children("[data-id=" + id + "]");

        this.get_contentNode().children().hide();

        assemblerNode.css({
            display: "",
            visibility: "hidden"
        });

    },

    template: function () {

        var $result = $("<div></div>");

        $result.addClass("-pd-fs-layout");
        $result.addClass("-pd-fs-layout-simple");
        $result.attr("data-id", "container");

        $result.append("<div class=\"-pd-fs-layout-simple-content\" style='background-color:#EEEEEE;'></div>");

        return $result;

    },

    //================================
    // PUBLIC OVERRIDDEN METHODS
    //================================

    render: function (data) {

        var $result = this.template(),
            $content = $result.find(".-pd-fs-layout-simple-content");

        data.each(function (index, item) {
            $content.append("<div data-id=\"" + item.id + "\" data-role=\"assembler-container\" style=\"box-sizing:border-box;height:100%;position:relative;\">" + item.content + "</div>");
        });

        return $result[0].outerHTML;

    }

});