UNPKG

nakedobjects.spa

Version:

Single Page Application client for a Naked Objects application.

42 lines 1.76 kB
var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); import { Command } from './Command'; import * as Msg from '../user-messages'; import * as RtD from '../route-data'; var Cancel = (function (_super) { __extends(Cancel, _super); function Cancel() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.shortCommand = "ca"; _this.fullCommand = Msg.cancelCommand; _this.helpText = Msg.cancelHelp; _this.minArguments = 0; _this.maxArguments = 0; return _this; } Cancel.prototype.isAvailableInCurrentContext = function () { return this.isDialog() || this.isEdit(); }; Cancel.prototype.doExecute = function (args, chained) { var _this = this; if (this.isEdit()) { return this.returnResult("", "", function () { return _this.urlManager.setInteractionMode(RtD.InteractionMode.View); }); } if (this.isDialog()) { return this.returnResult("", "", function () { return _this.urlManager.closeDialogReplaceHistory(_this.routeData().dialogId); }); } return this.returnResult("", "some sort of error"); // todo }; ; return Cancel; }(Command)); export { Cancel }; //# sourceMappingURL=cancel.js.map