all files / document-editor-container/ribbon/layout-tab/ layout-tab.js

92.31% Statements 24/26
33.33% Branches 2/6
85.71% Functions 6/7
92.31% Lines 24/26
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46   14× 14× 14× 14×   14×                   22× 22×           14× 14×   14× 14×   14× 14×        
define(["require", "exports", "./index", "./layout-paragraph-group", "../ribbon-base/ribbon-constants"], function (require, exports, index_1, layout_paragraph_group_1, ribbon_constants_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.LAYOUT_TAB_ID = '_layout_tab';
    var LayoutTab = (function () {
        function LayoutTab(container) {
            this.container = container;
            this.localObj = this.container.localObj;
            this.pageSetupGroup = new index_1.PageSetupGroup(container);
            this.layoutParagraphGroup = new layout_paragraph_group_1.LayoutParagraphGroup(container);
        }
        LayoutTab.prototype.getLayoutTab = function () {
            return {
                id: this.container.element.id + ribbon_constants_1.RIBBON_ID + exports.LAYOUT_TAB_ID,
                keyTip: 'P',
                header: this.localObj.getConstant('Layout'),
                groups: [
                    this.pageSetupGroup.getGroupModel(),
                    this.layoutParagraphGroup.getGroupModel()
                ]
            };
        };
        LayoutTab.prototype.updateControlState = function () {
            this.layoutParagraphGroup.updateSelection();
            this.pageSetupGroup.updateSelection();
        };
        LayoutTab.prototype.wireEvents = function () {
            if (this.pageSetupGroup.wireEvents) {
                this.pageSetupGroup.wireEvents();
            }
        };
        LayoutTab.prototype.destroy = function () {
            Eif (this.pageSetupGroup.destroy) {
                this.pageSetupGroup.destroy();
            }
            Eif (this.layoutParagraphGroup.destroy) {
                this.layoutParagraphGroup.destroy();
            }
            this.pageSetupGroup = undefined;
            this.layoutParagraphGroup = undefined;
        };
        return LayoutTab;
    }());
    exports.LayoutTab = LayoutTab;
});