UNPKG

@web-atoms/core

Version:
35 lines (34 loc) 1.34 kB
System.register(["tslib", "../services/NavigationService", "./AtomViewModel"], function (_export, _context) { "use strict"; var __awaiter, NavigationService, AtomViewModel, AtomWindowViewModel; _export("AtomWindowViewModel", void 0); return { setters: [function (_tslib) { __awaiter = _tslib.__awaiter; }, function (_servicesNavigationService) { NavigationService = _servicesNavigationService.NavigationService; }, function (_AtomViewModel) { AtomViewModel = _AtomViewModel.AtomViewModel; }], execute: function () { _export("AtomWindowViewModel", AtomWindowViewModel = class AtomWindowViewModel extends AtomViewModel { close(result) { this.app.broadcast(`atom-window-close:${this.windowName}`, result); } cancel() { return __awaiter(this, void 0, void 0, function* () { if (this.closeWarning) { const navigationService = this.app.resolve(NavigationService); if (!(yield navigationService.confirm(this.closeWarning, "Are you sure?"))) { return false; } } this.app.broadcast(`atom-window-cancel:${this.windowName}`, "cancelled"); return true; }); } }); } }; }); //# sourceMappingURL=AtomWindowViewModel.js.map