/// class ProspectDirector.Modules.Explorer.Contents.CanvasContent 
/// using ProspectDirector.Modules.Explorer.Contents.ExplorerContent

ProspectDirector.Modules.Explorer.Contents.CanvasContent =
    ProspectDirector.Modules.Explorer.Contents.ExplorerContent.extend({

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

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

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

    get_splitter: function () {
        return this.get_container().find("[data-id=explorer-content-splitter]");
    },

    //===================================
    // INITIALIZERS
    //===================================

    init_splitter: function () {

        new ProspectDirector.Types.Core.ViewportSplitter({
            selector: this.get_splitter().selector
        });

    },

    init_surface: function () {
        
        new PDJS.Canvas.Actual.CanvasViewBox({
            container: $(".form-content.canvas-main"),
            documentId: this.options.data.documentId,
            entityId: this.options.data.entityId,
            createContext: false
        });
        
    },
    
    //===================================
    // PUBLIC METHODS
    //===================================

    unload: function () {

        var splitter = this.get_splitter().data("viewportSplitter");

        if (splitter) {
            splitter.destroy();
        }

    }

});