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;
});
|