/// class PD.Manage.ManageMain
// using PD.Web.UI.Control

PD.Manage.ManageMain = PD.Web.UI.Controls.Control.extend({

    //===================================
    // PROPERTIES
    //===================================

    get_splitter: function () {
        return this.get_node()
            .find(".-pd-primary-splitter")
            .data("kendoSplitter");
    },

    //===================================
    // EVENT HANDLERS
    //===================================

    onInit: function (e) {
        this.get_children().add(new PD.Manage.ModuleZone({
            insertAt: ".-pd-primary-splitter"
        }));
    },

    onActivate: function (e) {

        var that = this;

        this.get_node().find(".-pd-primary-splitter").kendoSplitter({
            orientation: "horizontal",
            panes: [
                {}
            ],
            resize: PD.BCL.Util.debounce(function () {
                PD.context.get_global().get_events().publish("Area:Resized");
            }, 100)
        });

        setTimeout(() => {
            this.get_splitter().resize();
        }, 50);
        
    },

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

    template: function (e) {
        return [
            "<div class='-pd-manage-main'>",
                "<div class='-pd-primary-splitter'></div>",
            "</div>"
        ];
    }

});