Skip to content
Snippets Groups Projects
Commit f862ed14 authored by Danila Fedorin's avatar Danila Fedorin
Browse files

Hide links when opening policy, show policy when navigated after load

parent c25a9dae
No related branches found
No related tags found
No related merge requests found
...@@ -50,13 +50,22 @@ export class RootViewModel extends ViewModel { ...@@ -50,13 +50,22 @@ export class RootViewModel extends ViewModel {
this.emitChange(); this.emitChange();
} }
_hideLinks() {
this.link = null;
this.openLinkViewModel = null;
this.createLinkViewModel = null;
}
updateHash(hash) { updateHash(hash) {
if (hash.startsWith("#/policy/")) { if (hash.startsWith("#/policy/")) {
const server = hash.substr(9); const server = hash.substr(9);
this._hideLinks();
this.loadServerPolicyViewModel = new LoadServerPolicyViewModel(this.childOptions({server})); this.loadServerPolicyViewModel = new LoadServerPolicyViewModel(this.childOptions({server}));
this.loadServerPolicyViewModel.load(); this.loadServerPolicyViewModel.load();
this.emitChange();
} else { } else {
const oldLink = this.link; const oldLink = this.link;
this.loadServerPolicyViewModel = null;
this.link = Link.parse(hash); this.link = Link.parse(hash);
this._updateChildVMs(oldLink); this._updateChildVMs(oldLink);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment