Code coverage report for src/js/base/renderer.js

# all files / src/js/base/ renderer.js

100% Statements 40/40
94.44% Branches 34/36
100% Functions 9/9
100% Lines 39/39

    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
    611×
    1×
    1×
    1×
    2×
    8516×
    8516×
    8516×
    8516×

    1×
    8456×
    8456×
    3853×

    8456×
    4328×

    8456×
    555×
    555×

    8456×
    3846×

    8456×
    8456×
    8456×
    2453×

    8456×
    5863×

    8456×
    615×

    8456×
    2453×

    8456×

    1×

    1×

    4095×
    8516×
    8516×
    8516×
    341×

    8516×

     (function(global){global.wrappers['/Users/lqez/Dev/summernote/src/js/base/renderer.js']=[function(require,module,exports,__dirname,__filename){ "use strict";
    exports.__esModule = true;
    var jquery_1 = require("jquery");
    var Renderer = /** @class */ (function () {
        function Renderer(markup, children, options, callback) {
            this.markup = markup;
            this.children = children;
            this.options = options;
            this.callback = callback;
        }
        Renderer.prototype.render = function ($parent) {
            var $node = jquery_1["default"](this.markup);
            if (this.options && this.options.contents) {
                $node.html(this.options.contents);
            }
            if (this.options && this.options.className) {
                $node.addClass(this.options.className);
            }
            if (this.options && this.options.data) {
                jquery_1["default"].each(this.options.data, function (k, v) {
                    $node.attr('data-' + k, v);
                });
            }
            if (this.options && this.options.click) {
                $node.on('click', this.options.click);
            }
            Eif (this.children) {
                var $container_1 = $node.find('.note-children-container');
                this.children.forEach(function (child) {
                    child.render($container_1.length ? $container_1 : $node);
                });
            }
            if (this.callback) {
                this.callback($node, this.options);
            }
            if (this.options && this.options.callback) {
                this.options.callback($node);
            }
            if ($parent) {
                $parent.append($node);
            }
            return $node;
        };
        return Renderer;
    }());
    exports["default"] = {
        create: function (markup, callback) {
            return function () {
                var options = typeof arguments[1] === 'object' ? arguments[1] : arguments[0];
                var children = jquery_1["default"].isArray(arguments[0]) ? arguments[0] : [];
                if (options && options.children) {
                    children = options.children;
                }
                return new Renderer(markup, children, options, callback);
            };
        }
    };

    },'src/js/base/renderer.js',{"jquery":"/Users/lqez/Dev/summernote/node_modules/jquery/dist/jquery.js"}];})(this);
    //# sourceMappingURL=data:application/json;charset=utf-8;base64,[encoded data, 5020 characters]