define(["require", "exports", "../../common/constant", "../../common/constant"], function (require, exports, constants, constant_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var EventService = (function () {
function EventService(manager) {
this.parent = manager;
this.blockChanges = [];
this.addEventListener();
}
EventService.prototype.addEventListener = function () {
this.parent.observer.on(constants.CLEAREVENTCHANGES, this.clearEventChanges, this);
this.parent.observer.on(constant_1.events.destroy, this.destroy, this);
};
EventService.prototype.removeEventListener = function () {
this.parent.observer.off(constants.CLEAREVENTCHANGES, this.clearEventChanges);
this.parent.observer.off(constant_1.events.destroy, this.destroy);
};
EventService.prototype.addChange = function (change) {
this.blockChanges.push(change);
};
EventService.prototype.getChanges = function () {
return this.blockChanges;
};
EventService.prototype.clearEventChanges = function () {
this.blockChanges = [];
};
EventService.prototype.destroy = function () {
this.blockChanges = null;
this.removeEventListener();
};
return EventService;
}());
exports.EventService = EventService;
});
|