Mass Tabs -> Spaces conversion

This commit is contained in:
Michael Telatynski
2021-07-23 12:25:21 +01:00
parent 9caf2ce268
commit acd881385c
31 changed files with 789 additions and 789 deletions
+33 -33
View File
@@ -23,51 +23,51 @@ import {LoadServerPolicyViewModel} from "./policy/LoadServerPolicyViewModel.js";
import {Platform} from "./Platform.js";
export class RootViewModel extends ViewModel {
constructor(options) {
super(options);
this.link = null;
this.openLinkViewModel = null;
this.createLinkViewModel = null;
constructor(options) {
super(options);
this.link = null;
this.openLinkViewModel = null;
this.createLinkViewModel = null;
this.loadServerPolicyViewModel = null;
this.preferences.on("canClear", () => {
this.emitChange();
});
}
}
_updateChildVMs(oldLink) {
if (this.link) {
this.createLinkViewModel = null;
if (!oldLink || !oldLink.equals(this.link)) {
this.openLinkViewModel = new OpenLinkViewModel(this.childOptions({
link: this.link,
clients: createClients(),
}));
}
} else {
this.openLinkViewModel = null;
this.createLinkViewModel = new CreateLinkViewModel(this.childOptions());
}
this.emitChange();
}
_updateChildVMs(oldLink) {
if (this.link) {
this.createLinkViewModel = null;
if (!oldLink || !oldLink.equals(this.link)) {
this.openLinkViewModel = new OpenLinkViewModel(this.childOptions({
link: this.link,
clients: createClients(),
}));
}
} else {
this.openLinkViewModel = null;
this.createLinkViewModel = new CreateLinkViewModel(this.childOptions());
}
this.emitChange();
}
updateHash(hash) {
updateHash(hash) {
if (hash.startsWith("#/policy/")) {
const server = hash.substr(9);
this.loadServerPolicyViewModel = new LoadServerPolicyViewModel(this.childOptions({server}));
this.loadServerPolicyViewModel.load();
} else {
const oldLink = this.link;
this.link = Link.parse(hash);
this._updateChildVMs(oldLink);
const oldLink = this.link;
this.link = Link.parse(hash);
this._updateChildVMs(oldLink);
}
}
}
clearPreferences() {
this.preferences.clear();
this._updateChildVMs();
}
clearPreferences() {
this.preferences.clear();
this._updateChildVMs();
}
get hasPreferences() {
return this.preferences.canClear;
}
get hasPreferences() {
return this.preferences.canClear;
}
}