Code coverage report for src/js/lite/ui/ModalUI.js

# all files / src/js/lite/ui/ ModalUI.js

12.5% Statements 3/24
0% Branches 0/4
16.67% Functions 1/6
8.7% Lines 2/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
    361×

    2×

     (function(global){global.wrappers['/Users/lqez/Dev/summernote/src/js/lite/ui/ModalUI.js']=[function(require,module,exports,__dirname,__filename){ "use strict";
    exports.__esModule = true;
    var ModalUI = /** @class */ (function () {
        function ModalUI($node, options) {
            this.options = $.extend({}, {
                target: options.container || 'body'
            }, options);
            this.$modal = $node;
            this.$backdrop = $('<div class="note-modal-backdrop" />');
        }
        ModalUI.prototype.show = function () {
            if (this.options.target === 'body') {
                this.$backdrop.css('position', 'fixed');
                this.$modal.css('position', 'fixed');
            }
            else {
                this.$backdrop.css('position', 'absolute');
                this.$modal.css('position', 'absolute');
            }
            this.$backdrop.appendTo(this.options.target).show();
            this.$modal.appendTo(this.options.target).addClass('open').show();
            this.$modal.trigger('note.modal.show');
            this.$modal.off('click', '.close').on('click', '.close', this.hide.bind(this));
        };
        ModalUI.prototype.hide = function () {
            this.$modal.removeClass('open').hide();
            this.$backdrop.hide();
            this.$modal.trigger('note.modal.hide');
        };
        return ModalUI;
    }());
    exports["default"] = ModalUI;

    },'src/js/lite/ui/ModalUI.js',{}];})(this);
    //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTW9kYWxVSS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIk1vZGFsVUkuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTtJQUNFLGlCQUFZLEtBQUssRUFBRSxPQUFPO1FBQ3hCLElBQUksQ0FBQyxPQUFPLEdBQUcsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxFQUFFLEV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