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

100% Statements 49/49
50% Branches 7/14
100% Functions 9/9
100% Lines 49/49
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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79   14× 14×   14× 14× 14× 14× 14× 14×   14×                           118× 118× 118× 118× 118×   175×   113× 113×     14× 14× 14×   14× 14× 14×   14× 14× 14×   14× 14× 14×   14× 14× 14×   14× 14× 14×          
define(["require", "exports", "./history-group", "./clipboard-group", "./font-group", "./home-paragraph-group", "./find-group", "./styles-group", "../ribbon-base/ribbon-constants"], function (require, exports, history_group_1, clipboard_group_1, font_group_1, home_paragraph_group_1, find_group_1, styles_group_1, ribbon_constants_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.HOME_TAB_ID = '_home_tab';
    exports.HOME_TAB_TEXT = 'Home';
    var HomeTab = (function () {
        function HomeTab(container) {
            this.container = container;
            this.initialize();
        }
        HomeTab.prototype.initialize = function () {
            this.historyGroup = new history_group_1.HistoryGroup(this.container);
            this.clipboardGroup = new clipboard_group_1.ClipboardGroup(this.container);
            this.fontGroup = new font_group_1.FontGroup(this.container);
            this.paragraphGroup = new home_paragraph_group_1.HomeParagraphGroup(this.container);
            this.findGroup = new find_group_1.FindGroup(this.container);
            this.stylesGroup = new styles_group_1.StylesGroup(this.container);
        };
        HomeTab.prototype.getHomeTab = function () {
            return {
                id: this.container.element.id + ribbon_constants_1.RIBBON_ID + exports.HOME_TAB_ID,
                header: this.container.localObj.getConstant(exports.HOME_TAB_TEXT),
                keyTip: 'H',
                groups: [
                    this.historyGroup.getGroupModel(),
                    this.clipboardGroup.getGroupModel(),
                    this.fontGroup.getGroupModel(),
                    this.paragraphGroup.getGroupModel(),
                    this.stylesGroup.getGroupModel(),
                    this.findGroup.getGroupModel()
                ]
            };
        };
        HomeTab.prototype.updateSelection = function () {
            this.clipboardGroup.updateSelection();
            this.fontGroup.updateSelection();
            this.paragraphGroup.updateSelection();
            this.findGroup.updateSelection();
            this.stylesGroup.updateStyleGallery();
        };
        HomeTab.prototype.updateContentChanged = function () {
            this.historyGroup.updateContentChanged();
        };
        HomeTab.prototype.updateStyleGallery = function () {
            Eif (this.stylesGroup) {
                this.stylesGroup.updateStyleGallery();
            }
        };
        HomeTab.prototype.destroy = function () {
            Eif (this.historyGroup) {
                this.historyGroup.destroy();
                this.historyGroup = null;
            }
            Eif (this.clipboardGroup) {
                this.clipboardGroup.destroy();
                this.clipboardGroup = null;
            }
            Eif (this.fontGroup) {
                this.fontGroup.destroy();
                this.fontGroup = null;
            }
            Eif (this.paragraphGroup) {
                this.paragraphGroup.destroy();
                this.paragraphGroup = null;
            }
            Eif (this.findGroup) {
                this.findGroup.destroy();
                this.findGroup = null;
            }
            Eif (this.stylesGroup) {
                this.stylesGroup.destroy();
                this.stylesGroup = null;
            }
        };
        return HomeTab;
    }());
    exports.HomeTab = HomeTab;
});