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

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

97.37% Statements 37/38
75% Branches 3/4
100% Functions 8/8
97.3% Lines 36/37

    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
    561×
    1×
    1×
    1×
    2×
    98×
    98×
    98×
    98×
    98×
    98×
    98×
    98×
    98×
    1×

    1×
    2×
    2×
    2×

    1×
    2×
    2×
    1×
    1×
    1×
    1×
    1×

    1×
    1×
    1×
    1×

    2×

    1×
    7×

    1×

    1×

     (function(global){global.wrappers['/Users/lqez/Dev/summernote/src/js/base/module/Fullscreen.js']=[function(require,module,exports,__dirname,__filename){ "use strict";
    exports.__esModule = true;
    var jquery_1 = require("jquery");
    var Fullscreen = /** @class */ (function () {
        function Fullscreen(context) {
            var _this = this;
            this.context = context;
            this.$editor = context.layoutInfo.editor;
            this.$toolbar = context.layoutInfo.toolbar;
            this.$editable = context.layoutInfo.editable;
            this.$codable = context.layoutInfo.codable;
            this.$window = jquery_1["default"](window);
            this.$scrollbar = jquery_1["default"]('html, body');
            this.onResize = function () {
                _this.resizeTo({
                    h: _this.$window.height() - _this.$toolbar.outerHeight()
                });
            };
        }
        Fullscreen.prototype.resizeTo = function (size) {
            this.$editable.css('height', size.h);
            this.$codable.css('height', size.h);
            Iif (this.$codable.data('cmeditor')) {
                this.$codable.data('cmeditor').setsize(null, size.h);
            }
        };
        /**
         * toggle fullscreen
         */
        Fullscreen.prototype.toggle = function () {
            this.$editor.toggleClass('fullscreen');
            if (this.isFullscreen()) {
                this.$editable.data('orgHeight', this.$editable.css('height'));
                this.$editable.data('orgMaxHeight', this.$editable.css('maxHeight'));
                this.$editable.css('maxHeight', '');
                this.$window.on('resize', this.onResize).trigger('resize');
                this.$scrollbar.css('overflow', 'hidden');
            }
            else {
                this.$window.off('resize', this.onResize);
                this.resizeTo({ h: this.$editable.data('orgHeight') });
                this.$editable.css('maxHeight', this.$editable.css('orgMaxHeight'));
                this.$scrollbar.css('overflow', 'visible');
            }
            this.context.invoke('toolbar.updateFullscreen', this.isFullscreen());
        };
        Fullscreen.prototype.isFullscreen = function () {
            return this.$editor.hasClass('fullscreen');
        };
        return Fullscreen;
    }());
    exports["default"] = Fullscreen;

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