@wcardinal/wcardinal-geditor
Version:
WebGL-based graphic editor, tester and viewer for supervisory systems
47 lines • 1.62 kB
JavaScript
import { __extends } from "tslib";
import { DCommandBase } from "@wcardinal/wcardinal-ui";
var ECommandDocumentSnapDelete = /** @class */ (function (_super) {
__extends(ECommandDocumentSnapDelete, _super);
function ECommandDocumentSnapDelete(snapper, index, target) {
var _this = _super.call(this) || this;
_this._snapper = snapper;
_this._index = index;
_this._target = target;
return _this;
}
Object.defineProperty(ECommandDocumentSnapDelete.prototype, "snapper", {
get: function () {
return this._snapper;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ECommandDocumentSnapDelete.prototype, "index", {
get: function () {
return this._index;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ECommandDocumentSnapDelete.prototype, "target", {
get: function () {
return this._target;
},
enumerable: false,
configurable: true
});
ECommandDocumentSnapDelete.prototype.execute = function () {
return this.redo();
};
ECommandDocumentSnapDelete.prototype.redo = function () {
this._snapper.target.remove(this._index);
return true;
};
ECommandDocumentSnapDelete.prototype.undo = function () {
this._snapper.target.add(this._target, this._index);
return true;
};
return ECommandDocumentSnapDelete;
}(DCommandBase));
export { ECommandDocumentSnapDelete };
//# sourceMappingURL=e-command-document-snap-delete.js.map