all files / blockeditor/renderer/common/ toolbar-renderer.js

100% Statements 14/14
100% Branches 2/2
100% Functions 6/6
100% Lines 14/14
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   1397×   1392×     1392×                       1392×   11×        
define(["require", "exports", "@syncfusion/ej2-navigations", "../../../common/constant"], function (require, exports, ej2_navigations_1, constant_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var ToolbarRenderer = (function () {
        function ToolbarRenderer(editor) {
            this.editor = editor;
        }
        ToolbarRenderer.prototype.renderToolbar = function (args) {
            this.element = typeof args.element === 'string'
                ? this.editor.element.querySelector(args.element)
                : args.element;
            return new ej2_navigations_1.Toolbar({
                items: args.items,
                width: args.width,
                overflowMode: args.overflowMode,
                locale: this.editor.locale,
                cssClass: this.editor.cssClass,
                enableRtl: this.editor.enableRtl,
                enablePersistence: this.editor.enablePersistence,
                clicked: this.handleInlineToolbarItemClick.bind(this),
                created: this.handleInlineToolbarCreated.bind(this)
            }, this.element);
        };
        ToolbarRenderer.prototype.handleInlineToolbarCreated = function (args) {
            this.editor.notify(constant_1.events.inlineToolbarCreated, args);
        };
        ToolbarRenderer.prototype.handleInlineToolbarItemClick = function (args) {
            this.editor.notify(constant_1.events.inlineToolbarItemClick, args);
        };
        return ToolbarRenderer;
    }());
    exports.ToolbarRenderer = ToolbarRenderer;
});