Code coverage report for src/js/base/module/Statusbar.js

# all files / src/js/base/module/ Statusbar.js

62.5% Statements 20/32
37.5% Branches 3/8
66.67% Functions 6/9
61.29% Lines 19/31

    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
    431×
    1×
    1×
    1×
    1×
    2×
    97×
    97×
    97×
    97×

    1×
    97×
    97×

    97×

    1×
    2×
    2×

    1×

    1×

     (function(global){global.wrappers['/Users/lqez/Dev/summernote/src/js/base/module/Statusbar.js']=[function(require,module,exports,__dirname,__filename){ "use strict";
    exports.__esModule = true;
    var jquery_1 = require("jquery");
    var EDITABLE_PADDING = 24;
    var Statusbar = /** @class */ (function () {
        function Statusbar(context) {
            this.$document = jquery_1["default"](document);
            this.$statusbar = context.layoutInfo.statusbar;
            this.$editable = context.layoutInfo.editable;
            this.options = context.options;
        }
        Statusbar.prototype.initialize = function () {
            var _this = this;
            Iif (this.options.airMode || this.options.disableResizeEditor) {
                this.destroy();
                return;
            }
            this.$statusbar.on('mousedown', function (event) {
                event.preventDefault();
                event.stopPropagation();
                var editableTop = _this.$editable.offset().top - _this.$document.scrollTop();
                var onMouseMove = function (event) {
                    var height = event.clientY - (editableTop + EDITABLE_PADDING);
                    height = (_this.options.minheight > 0) ? Math.max(height, _this.options.minheight) : height;
                    height = (_this.options.maxHeight > 0) ? Math.min(height, _this.options.maxHeight) : height;
                    _this.$editable.height(height);
                };
                _this.$document.on('mousemove', onMouseMove).one('mouseup', function () {
                    _this.$document.off('mousemove', onMouseMove);
                });
            });
        };
        Statusbar.prototype.destroy = function () {
            this.$statusbar.off();
            this.$statusbar.addClass('locked');
        };
        return Statusbar;
    }());
    exports["default"] = Statusbar;

    },'src/js/base/module/Statusbar.js',{"jquery":"/Users/lqez/Dev/summernote/node_modules/jquery/dist/jquery.js"}];})(this);
    //# sourceM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