all files / schedule/actions/ scroll.js

100% Statements 29/29
100% Branches 0/0
100% Functions 11/11
100% Lines 29/29
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   975× 975×   3094×   4069×   4069×   975× 975×   975× 975×   3094× 3094× 3094× 3094×   14×   975×        
define(["require", "exports", "@syncfusion/ej2-base", "../base/constant"], function (require, exports, ej2_base_1, constant_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var Scroll = (function () {
        function Scroll(parent) {
            this.parent = parent;
            this.addEventListener();
        }
        Scroll.prototype.getModuleName = function () {
            return 'scroll';
        };
        Scroll.prototype.setWidth = function () {
            this.parent.element.style.width = ej2_base_1.formatUnit(this.parent.width);
        };
        Scroll.prototype.setHeight = function () {
            this.parent.element.style.height = ej2_base_1.formatUnit(this.parent.height);
        };
        Scroll.prototype.addEventListener = function () {
            this.parent.on(constant_1.contentReady, this.setDimensions, this);
            this.parent.on(constant_1.uiUpdate, this.onPropertyChanged, this);
        };
        Scroll.prototype.removeEventListener = function () {
            this.parent.off(constant_1.contentReady, this.setDimensions);
            this.parent.off(constant_1.uiUpdate, this.onPropertyChanged);
        };
        Scroll.prototype.setDimensions = function () {
            this.setWidth();
            this.setHeight();
            var data = { cssProperties: this.parent.getCssProperties(), module: this.getModuleName() };
            this.parent.notify(constant_1.scrollUiUpdate, data);
        };
        Scroll.prototype.onPropertyChanged = function () {
            this.setDimensions();
        };
        Scroll.prototype.destroy = function () {
            this.removeEventListener();
        };
        return Scroll;
    }());
    exports.Scroll = Scroll;
});