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

100% Statements 27/27
50% Branches 3/6
100% Functions 6/6
100% Lines 27/27
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 47   14× 14× 14× 14×   14×                     55× 55×   14× 14×   14× 14×   14× 14×   14× 14× 14× 14×        
define(["require", "exports", "./views-group", "./zoom-group", "./show-group", "../ribbon-base/ribbon-constants"], function (require, exports, views_group_1, zoom_group_1, show_group_1, ribbon_constants_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.VIEW_TAB_ID = '_view_tab';
    var ViewTab = (function () {
        function ViewTab(container) {
            this.container = container;
            this.viewsGroup = new views_group_1.ViewsGroup(container);
            this.zoomGroup = new zoom_group_1.ZoomGroup(container);
            this.showGroup = new show_group_1.ShowGroup(container);
        }
        ViewTab.prototype.getViewTab = function () {
            return {
                id: this.container.element.id + ribbon_constants_1.RIBBON_ID + exports.VIEW_TAB_ID,
                header: this.container.localObj.getConstant('View'),
                keyTip: 'W',
                groups: [
                    this.viewsGroup.getGroupModel(),
                    this.zoomGroup.getGroupModel(),
                    this.showGroup.getGroupModel()
                ]
            };
        };
        ViewTab.prototype.onSelectionChange = function () {
            this.viewsGroup.updateSelection();
            this.showGroup.updateSelection();
        };
        ViewTab.prototype.destroy = function () {
            Eif (this.viewsGroup) {
                this.viewsGroup.destroy();
            }
            Eif (this.zoomGroup) {
                this.zoomGroup.destroy();
            }
            Eif (this.showGroup) {
                this.showGroup.destroy();
            }
            this.viewsGroup = undefined;
            this.zoomGroup = undefined;
            this.showGroup = undefined;
            this.container = undefined;
        };
        return ViewTab;
    }());
    exports.ViewTab = ViewTab;
});