all files / pager/ external-message.js

100% Statements 26/26
100% Branches 10/10
100% Functions 9/9
100% Lines 26/26
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   109×   425×   63× 63× 63×   190× 93× 93×     97×     98× 95×     94×   63× 61×          
define(["require", "exports", "@syncfusion/ej2-base"], function (require, exports, ej2_base_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var ExternalMessage = (function () {
        function ExternalMessage(pagerModule) {
            this.pagerModule = pagerModule;
        }
        ExternalMessage.prototype.getModuleName = function () {
            return 'externalMessage';
        };
        ExternalMessage.prototype.render = function () {
            this.element = ej2_base_1.createElement('div', { className: 'e-pagerexternalmsg', attrs: { 'aria-label': this.pagerModule.getLocalizedLabel('ExternalMsg') } });
            this.pagerModule.element.appendChild(this.element);
            this.refresh();
        };
        ExternalMessage.prototype.refresh = function () {
            if (this.pagerModule.externalMessage && this.pagerModule.externalMessage.toString().length) {
                this.showMessage();
                this.element.innerHTML = this.pagerModule.externalMessage;
            }
            else {
                this.hideMessage();
            }
        };
        ExternalMessage.prototype.hideMessage = function () {
            if (!ej2_base_1.isNullOrUndefined(this.element)) {
                this.element.style.display = 'none';
            }
        };
        ExternalMessage.prototype.showMessage = function () {
            this.element.style.display = '';
        };
        ExternalMessage.prototype.destroy = function () {
            if (this.element && this.element.parentElement) {
                ej2_base_1.remove(this.element);
            }
        };
        return ExternalMessage;
    }());
    exports.ExternalMessage = ExternalMessage;
});