UNPKG

@wcardinal/wcardinal-geditor

Version:

WebGL-based graphic editor, tester and viewer for supervisory systems

47 lines 1.72 kB
import { __extends } from "tslib"; import { DApplications, DCommandBase } from "@wcardinal/wcardinal-ui"; var ECommandLayerBringForward = /** @class */ (function (_super) { __extends(ECommandLayerBringForward, _super); function ECommandLayerBringForward(index, layerContainer) { var _this = _super.call(this) || this; _this._index = index; _this._layerContainer = layerContainer; return _this; } Object.defineProperty(ECommandLayerBringForward.prototype, "index", { get: function () { return this._index; }, enumerable: false, configurable: true }); Object.defineProperty(ECommandLayerBringForward.prototype, "layerContainer", { get: function () { return this._layerContainer; }, enumerable: false, configurable: true }); ECommandLayerBringForward.prototype.execute = function () { return this.redo(); }; ECommandLayerBringForward.prototype.redo = function () { var index = this._index; var layerContainer = this._layerContainer; var children = layerContainer.children; var tmp = children[index]; children[index] = children[index + 1]; children[index + 1] = tmp; layerContainer.onChildrenChange(index); layerContainer.emit("change", layerContainer); DApplications.update(layerContainer); return true; }; ECommandLayerBringForward.prototype.undo = function () { this.redo(); return true; }; return ECommandLayerBringForward; }(DCommandBase)); export { ECommandLayerBringForward }; //# sourceMappingURL=e-command-layer-bring-forward.js.map