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

100% Statements 23/23
50% Branches 2/4
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   14× 14× 14× 14×   14×                   35× 35×   14× 14×   14× 14×   14× 14×        
define(["require", "exports", "@syncfusion/ej2-base", "./table-of-contents-group", "./footnotes-group", "../ribbon-base/ribbon-constants"], function (require, exports, ej2_base_1, table_of_contents_group_1, footnotes_group_1, ribbon_constants_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.REFERENCES_TAB_ID = '_reference_tab';
    var ReferenceTab = (function () {
        function ReferenceTab(container) {
            this.container = container;
            this.localObj = new ej2_base_1.L10n('documenteditorcontainer', this.container.defaultLocale, this.container.locale);
            this.tableOfContentsGroup = new table_of_contents_group_1.TableOfContentsGroup(this.container);
            this.footnotesGroup = new footnotes_group_1.FootnotesGroup(this.container);
        }
        ReferenceTab.prototype.getReferenceTab = function () {
            return {
                id: this.container.element.id + ribbon_constants_1.RIBBON_ID + exports.REFERENCES_TAB_ID,
                keyTip: 'S',
                header: this.localObj.getConstant('References'),
                groups: [
                    this.tableOfContentsGroup.getGroupModel(),
                    this.footnotesGroup.getGroupModel()
                ]
            };
        };
        ReferenceTab.prototype.updateSelectionState = function () {
            this.tableOfContentsGroup.updateSelection();
            this.footnotesGroup.updateSelection();
        };
        ReferenceTab.prototype.destroy = function () {
            Eif (this.tableOfContentsGroup) {
                this.tableOfContentsGroup.destroy();
            }
            Eif (this.footnotesGroup) {
                this.footnotesGroup.destroy();
            }
            this.tableOfContentsGroup = null;
            this.footnotesGroup = null;
        };
        return ReferenceTab;
    }());
    exports.ReferenceTab = ReferenceTab;
});