all files / rich-text-editor/renderer/ popup-renderer.js

100% Statements 22/22
100% Branches 0/0
100% Functions 8/8
100% Lines 22/22
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   1792×   166× 166×   1965× 1965× 1965×         1965× 1965×   1965×   1965×   1965×        
define(["require", "exports", "@syncfusion/ej2-popups", "../base/classes", "../base/constant"], function (require, exports, ej2_popups_1, classes_1, events) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var PopupRenderer = (function () {
        function PopupRenderer(parent) {
            this.parent = parent;
        }
        PopupRenderer.prototype.quickToolbarOpen = function () {
            var args = this.popupObj;
            this.parent.trigger(events.quickToolbarOpen, args);
        };
        PopupRenderer.prototype.renderPopup = function (args) {
            this.setPanel(args.element);
            this.renderPanel();
            args.popupObj = new ej2_popups_1.Popup(args.element, {
                targetType: 'relative',
                relateTo: this.parent.element,
                open: this.quickToolbarOpen.bind(this)
            });
            this.popupObj = args.popupObj;
            args.popupObj.hide();
        };
        PopupRenderer.prototype.renderPanel = function () {
            this.getPanel().classList.add(classes_1.CLS_QUICK_POP);
        };
        PopupRenderer.prototype.getPanel = function () {
            return this.popupPanel;
        };
        PopupRenderer.prototype.setPanel = function (panel) {
            this.popupPanel = panel;
        };
        return PopupRenderer;
    }());
    exports.PopupRenderer = PopupRenderer;
});