all files / document-editor-container/ribbon/table-design-tab/ table-design-tab.js

100% Statements 23/23
50% Branches 3/6
100% Functions 6/6
100% Lines 23/23
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   14× 14× 14× 14×   14×                   17× 17×     14× 14× 14×   14× 14× 14×          
define(["require", "exports", "./borders-group", "./shading-group", "../ribbon-base/ribbon-constants"], function (require, exports, borders_group_1, shading_group_1, ribbon_constants_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.TABLE_DESIGN_TAB_ID = '_table_design_tab';
    var TableDesignTab = (function () {
        function TableDesignTab(container) {
            this.container = container;
            this.localObj = this.container.localObj;
            this.bordersGroup = new borders_group_1.BordersGroup(container);
            this.shadingGroup = new shading_group_1.ShadingGroup(container);
        }
        TableDesignTab.prototype.getTableDesignTab = function () {
            return {
                id: this.container.element.id + ribbon_constants_1.RIBBON_ID + exports.TABLE_DESIGN_TAB_ID,
                keyTip: 'JT',
                header: this.localObj.getConstant('Table Design'),
                groups: [
                    this.bordersGroup.getBordersGroup(),
                    this.shadingGroup.getShadingGroup()
                ]
            };
        };
        TableDesignTab.prototype.onSelectionChange = function () {
            Eif (this.container.documentEditor.selection) {
                this.shadingGroup.updateShadingColor();
            }
        };
        TableDesignTab.prototype.destroy = function () {
            Eif (this.bordersGroup) {
                this.bordersGroup.destroy();
                this.bordersGroup = undefined;
            }
            Eif (this.shadingGroup) {
                this.shadingGroup.destroy();
                this.shadingGroup = undefined;
            }
        };
        return TableDesignTab;
    }());
    exports.TableDesignTab = TableDesignTab;
});