/// class ProspectDirector.Modules.EntityTypes.FeatureCanvasProperties
/// using ProspectDirector.Types.Core.Feature

ProspectDirector.Modules.EntityTypes.FeatureCanvasProperties =
    ProspectDirector.Types.Core.Feature.extend({

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

        init: function (options) {

            this._super(options);

            this.get_buttonEdit().on("click", $.proxy(this.buttonEdit_onClick, this));

        },

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

        get_buttonEdit: function () {
            return this.get_container().find("INPUT[type=button]");
        },

        get_hasChanges: function () {
            return this.get_container().find("INPUT[data-role=has-changes]");
        },

        //---------------------------
        //--- EVENT HANDLERS
        //---------------------------

        buttonEdit_onClick: function (e) {

            var that = this;

            PDJS.Canvas.Design.DesignerDialog.open({
                documentId: this.options.data.documentId,
                canvasType: PDJS.Canvas.Core.CanvasType.Properties,
                callbacks: {
                    ok: function (sender, e) {
                        if (e.hasChanged) {
                            that.get_hasChanges().val("1");
                            that.get_hasChanges().change();
                        }
                    }
                }
            });

        },

        formDesign_onOk: function (sender, e) {
            this.updateLayout(e);
        }

    });