define(["require", "exports", "../base/constant", "@syncfusion/ej2-base"], function (require, exports, events, ej2_base_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ExecCommandCallBack = (function () {
function ExecCommandCallBack(parent) {
this.parent = parent;
this.addEventListener();
}
ExecCommandCallBack.prototype.addEventListener = function () {
this.parent.on(events.execCommandCallBack, this.commandCallBack, this);
this.parent.on(events.destroy, this.removeEventListener, this);
};
ExecCommandCallBack.prototype.commandCallBack = function (args) {
var formatPainterCopy = !ej2_base_1.isNullOrUndefined(args.requestType) && args.requestType === 'FormatPainter' && args.action === 'format-copy';
if (!ej2_base_1.isNullOrUndefined(args) && !ej2_base_1.isNullOrUndefined(args.requestType) && args.requestType !== 'Undo' && args.requestType !== 'Redo' && !formatPainterCopy) {
this.parent.formatter.saveData();
}
this.parent.notify(events.toolbarRefresh, { args: args });
this.parent.notify(events.count, {});
};
ExecCommandCallBack.prototype.removeEventListener = function () {
this.parent.off(events.execCommandCallBack, this.commandCallBack);
this.parent.off(events.destroy, this.removeEventListener);
};
return ExecCommandCallBack;
}());
exports.ExecCommandCallBack = ExecCommandCallBack;
});
|