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

64.29% Statements 18/28
0% Branches 0/2
45.45% Functions 5/11
62.96% Lines 17/27

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

    1×
    99×

    1×

    1×

    1×

    1×

    1×

     (function(global){global.wrappers['/Users/lqez/Dev/summernote/src/js/base/module/Placeholder.js']=[function(require,module,exports,__dirname,__filename){ "use strict";
    exports.__esModule = true;
    var jquery_1 = require("jquery");
    var Placeholder = /** @class */ (function () {
        function Placeholder(context) {
            var _this = this;
            this.context = context;
            this.$editingArea = context.layoutInfo.editingArea;
            this.options = context.options;
            this.events = {
                'summernote.init summernote.change': function () {
                    _this.update();
                },
                'summernote.codeview.toggled': function () {
                    _this.update();
                }
            };
        }
        Placeholder.prototype.shouldInitialize = function () {
            return !!this.options.placeholder;
        };
        Placeholder.prototype.initialize = function () {
            var _this = this;
            this.$placeholder = jquery_1["default"]('<div class="note-placeholder">');
            this.$placeholder.on('click', function () {
                _this.context.invoke('focus');
            }).html(this.options.placeholder).prependTo(this.$editingArea);
            this.update();
        };
        Placeholder.prototype.destroy = function () {
            this.$placeholder.remove();
        };
        Placeholder.prototype.update = function () {
            var isShow = !this.context.invoke('codeview.isActivated') && this.context.invoke('editor.isEmpty');
            this.$placeholder.toggle(isShow);
        };
        return Placeholder;
    }());
    exports["default"] = Placeholder;

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