/// class ProspectDirector.Modules.ExplorerModel.Forms.FeatureContentList
/// using ProspectDirector.Types.Core.Feature

/**
@class FeatureContentList
@namespace ProspectDirector.Modules.ExplorerModel.Forms
**/
ProspectDirector.Modules.ExplorerModel.Forms.FeatureContentList = ProspectDirector.Types.Core.Feature.extend({

    //---------------------------
    //--- CONSTRUCTOR
    //---------------------------

    init: function (options) {

        this._super(options);

        this.get_allowCreateEntityNode().on("click", _.bind(this.allowCreateEntityNode_onClick, this));

        this.setPromptAfterCreateEnabledState(this.get_allowCreateEntity());

    },

    //---------------------------
    //--- PROPERTIES
    //---------------------------

    get_allowCreateEntityNode: function () {
        return this.get_container().find("[data-id=allowCreateEntity]");
    },

    get_promptAfterCreateDivNode: function () {
        return this.get_container().find("[data-id=promptAfterCreateDiv]");
    },

    get_allowCreateEntity: function () {
        return this.get_allowCreateEntityNode().is(":checked");
    },

    //---------------------------
    //--- PRIVATE METHODS
    //---------------------------

    allowCreateEntityNode_onClick: function (e) {
        this.setPromptAfterCreateEnabledState(this.get_allowCreateEntity());
    },

    setPromptAfterCreateEnabledState: function (enabled) {

        if (enabled) {
            this.get_promptAfterCreateDivNode().find("input,label").removeAttr("disabled");
        }
        else {
            this.get_promptAfterCreateDivNode().find("input,label").attr("disabled", "disabled");
        }

    }

});