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

100% Statements 48/48
50% Branches 8/16
100% Functions 6/6
100% Lines 48/48
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   14× 14× 14× 14× 14× 14× 14× 14× 14×   14× 14×                                 14× 14×   14× 14×   14× 14×   14× 14×   14× 14×   14× 14×   14× 14×   14× 14×   14× 14× 14× 14× 14× 14× 14× 14× 14×        
define(["require", "exports", "./pages-group", "./tables-group", "./illustrations-group", "./links-group", "./toc-group", "./bookmarks-group", "./comments-group", "./header-footer-group", "../ribbon-base/ribbon-constants"], function (require, exports, pages_group_1, tables_group_1, illustrations_group_1, links_group_1, toc_group_1, bookmarks_group_1, comments_group_1, header_footer_group_1, ribbon_constants_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.INSERT_TAB_ID = '_insert_tab';
    var InsertTab = (function () {
        function InsertTab(container) {
            this.container = container;
            this.pagesGroup = new pages_group_1.PagesGroup(container);
            this.tablesGroup = new tables_group_1.TablesGroup(container);
            this.illustrationsGroup = new illustrations_group_1.IllustrationsGroup(container);
            this.linksGroup = new links_group_1.LinksGroup(container);
            this.tocGroup = new toc_group_1.TOCGroup(container);
            this.bookmarksGroup = new bookmarks_group_1.BookmarksGroup(container);
            this.commentsGroup = new comments_group_1.CommentsGroup(container);
            this.headerFooterGroup = new header_footer_group_1.HeaderFooterGroup(container);
        }
        InsertTab.prototype.getInsertTab = function () {
            var id = this.container.element.id + ribbon_constants_1.RIBBON_ID;
            return {
                id: id + exports.INSERT_TAB_ID,
                header: this.container.localObj.getConstant('Insert'),
                keyTip: 'N',
                groups: [
                    this.pagesGroup.getGroupModel(),
                    this.tablesGroup.getGroupModel(),
                    this.illustrationsGroup.getGroupModel(),
                    this.linksGroup.getGroupModel(),
                    this.tocGroup.getGroupModel(),
                    this.bookmarksGroup.getGroupModel(),
                    this.commentsGroup.getGroupModel(),
                    this.headerFooterGroup.getGroupModel()
                ]
            };
        };
        InsertTab.prototype.updateControlState = function () {
            this.pagesGroup.updateSelection();
            this.commentsGroup.updateSelection();
        };
        InsertTab.prototype.destroy = function () {
            Eif (this.pagesGroup) {
                this.pagesGroup.destroy();
            }
            Eif (this.tablesGroup) {
                this.tablesGroup.destroy();
            }
            Eif (this.illustrationsGroup) {
                this.illustrationsGroup.destroy();
            }
            Eif (this.linksGroup) {
                this.linksGroup.destroy();
            }
            Eif (this.tocGroup) {
                this.tocGroup.destroy();
            }
            Eif (this.bookmarksGroup) {
                this.bookmarksGroup.destroy();
            }
            Eif (this.commentsGroup) {
                this.commentsGroup.destroy();
            }
            Eif (this.headerFooterGroup) {
                this.headerFooterGroup.destroy();
            }
            this.pagesGroup = undefined;
            this.tablesGroup = undefined;
            this.illustrationsGroup = undefined;
            this.linksGroup = undefined;
            this.tocGroup = undefined;
            this.bookmarksGroup = undefined;
            this.commentsGroup = undefined;
            this.headerFooterGroup = undefined;
            this.container = undefined;
        };
        return InsertTab;
    }());
    exports.InsertTab = InsertTab;
});