aboutsummaryrefslogtreecommitdiff
path: root/src/server/authentication/models/current_user_utils.ts
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-08-21 11:35:18 -0400
committerbob <bcz@cs.brown.edu>2019-08-21 11:35:18 -0400
commit186cf33322b6c96386c6e9fdb823025d09c5caeb (patch)
treec7085cbd6c68eed68ffed418c045fdb9aa862c7e /src/server/authentication/models/current_user_utils.ts
parent9984f2f19001c07e63738947172e12da25e4498e (diff)
extended treeview functionality - better indenting, state management, drag dropping.
Diffstat (limited to 'src/server/authentication/models/current_user_utils.ts')
-rw-r--r--src/server/authentication/models/current_user_utils.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/authentication/models/current_user_utils.ts b/src/server/authentication/models/current_user_utils.ts
index 508655605..aa3da0034 100644
--- a/src/server/authentication/models/current_user_utils.ts
+++ b/src/server/authentication/models/current_user_utils.ts
@@ -10,7 +10,7 @@ import { CollectionView } from "../../../client/views/collections/CollectionView
import { Doc } from "../../../new_fields/Doc";
import { List } from "../../../new_fields/List";
import { listSpec } from "../../../new_fields/Schema";
-import { Cast, StrCast } from "../../../new_fields/Types";
+import { Cast, StrCast, PromiseValue } from "../../../new_fields/Types";
import { Utils } from "../../../Utils";
import { RouteStore } from "../../RouteStore";
@@ -49,12 +49,14 @@ export class CurrentUserUtils {
workspaces.boxShadow = "0 0";
doc.workspaces = workspaces;
}
+ PromiseValue(Cast(doc.workspaces, Doc)).then(workspaces => workspaces && (workspaces.preventTreeViewOpen = true));
if (doc.recentlyClosed === undefined) {
const recentlyClosed = Docs.Create.TreeDocument([], { title: "Recently Closed", height: 75 });
recentlyClosed.excludeFromLibrary = true;
recentlyClosed.boxShadow = "0 0";
doc.recentlyClosed = recentlyClosed;
}
+ PromiseValue(Cast(doc.recentlyClosed, Doc)).then(recent => recent && (recent.preventTreeViewOpen = true));
if (doc.curPresentation === undefined) {
const curPresentation = Docs.Create.PresDocument(new List<Doc>(), { title: "Presentation" });
curPresentation.excludeFromLibrary = true;
@@ -73,6 +75,7 @@ export class CurrentUserUtils {
}
StrCast(doc.title).indexOf("@") !== -1 && (doc.title = StrCast(doc.title).split("@")[0] + "'s Library");
doc.width = 100;
+ doc.preventTreeViewOpen = true;
}
public static loadCurrentUser() {