import { BaseView } from "../../BaseView.js";
import FooterResizer from "./FooterResizer.js";
export default class FooterView extends BaseView {
    constructor(options) {
        super(options);
        this.m_parent = options.parent;
        this.state.unset("parent");
    }
    get parent() {
        return this.m_parent;
    }
    get source() {
        return super.source;
    }
    get contentNode() {
        return this.node.children(".-fb-grid-footer-content");
    }
    get contentTitleNode() {
        return this.contentNode.children(".-fb-grid-footer-content-title");
    }
    get contentBodyNode() {
        return this.contentNode.children(".-fb-grid-footer-content-body");
    }
    template() {
        return `<div class="-fb-grid-footer">
                    <div class="-fb-grid-footer-content">
                        <div class="-fb-grid-footer-content-title"></div>
                        <div class="-fb-grid-footer-content-body"></div>
                    </div>
                </div>`;
    }
    onActivate(e) {
        super.onActivate(e);
        this.source.locals.events.inputSelectedSubscribe((e) => {
            this.contentTitleNode.empty();
            this.contentTitleNode.append(`${e.model.label}`);
            this.contentBodyNode.empty();
            this.contentBodyNode.append(`${e.model.description}`);
        });
        this.resizer_init();
        let footerHeight = this.source.locals.storage.footerHeight;
        if (footerHeight != null) {
            this.node.css({
                height: `${footerHeight}px`
            });
        }
    }
    resizer_init() {
        this.m_resizer = new FooterResizer({
            grid: this.parent,
            footer: this,
            source: this.source
        });
        this.controls.add(this.m_resizer);
    }
}
