aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/CurrentUserUtils.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-08-13 09:08:04 -0400
committerbobzel <zzzman@gmail.com>2020-08-13 09:08:04 -0400
commit7d4867438fa2aa55a58184649f4e5042a68a3fd9 (patch)
tree77e0f8bb0e0ced1276283090b1d33c2f0f33f24c /src/client/util/CurrentUserUtils.ts
parent75dc5eb094bbac18310d4be49529743eb051789c (diff)
got rid of mainviewnotifs in favor of having badges for any fonticonbox
Diffstat (limited to 'src/client/util/CurrentUserUtils.ts')
-rw-r--r--src/client/util/CurrentUserUtils.ts15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index f3c405a1a..605bec2e8 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -503,11 +503,12 @@ export class CurrentUserUtils {
return doc.myItemCreators as Doc;
}
- static menuBtnDescriptions(): {
- title: string, icon: string, click: string,
+ static menuBtnDescriptions(doc: Doc): {
+ title: string, icon: string, click: string, watchedDocuments?: Doc
}[] {
+ this.setupSharingSidebar(doc); // sets up the right sidebar collection for mobile upload documents and sharing
return [
- { title: "Sharing", icon: "users", click: 'scriptContext.selectMenu(self, "Sharing")' },
+ { title: "Sharing", icon: "users", click: 'scriptContext.selectMenu(self, "Sharing")', watchedDocuments: doc["sidebar-sharing"] as Doc },
{ title: "Workspace", icon: "desktop", click: 'scriptContext.selectMenu(self, "Workspace")' },
{ title: "Catalog", icon: "file", click: 'scriptContext.selectMenu(self, "Catalog")' },
{ title: "Archive", icon: "archive", click: 'scriptContext.selectMenu(self, "Archive")' },
@@ -529,7 +530,7 @@ export class CurrentUserUtils {
}
static setupMenuPanel(doc: Doc) {
if (doc.menuStack === undefined) {
- const menuBtns = CurrentUserUtils.menuBtnDescriptions().map(({ title, icon, click }) =>
+ const menuBtns = CurrentUserUtils.menuBtnDescriptions(doc).map(({ title, icon, click, watchedDocuments }) =>
Docs.Create.FontIconDocument({
icon,
iconShape: "square",
@@ -539,6 +540,7 @@ export class CurrentUserUtils {
childDropAction: "same",
_width: 60,
_height: 60,
+ watchedDocuments,
onClick: ScriptField.MakeScript(click, { scriptContext: "any" }), system: true
}));
const userDoc = menuBtns[menuBtns.length - 1];
@@ -553,10 +555,6 @@ export class CurrentUserUtils {
_yMargin: 0,
_yPadding: 0, _xMargin: 0, _autoHeight: false, _width: 60, _columnWidth: 60, lockedPosition: true, _chromeStatus: "disabled", system: true
}));
-
- PromiseValue(Cast(doc.menuStack, Doc)).then(stack => {
- stack && !stack.sharingButtonId && (stack.sharingButtonId = menuBtns.find(button => button.title === "Sharing")![Id]);
- });
}
// this resets all sidebar buttons to being deactivated
PromiseValue(Cast(doc.menuStack, Doc)).then(stack => {
@@ -937,7 +935,6 @@ export class CurrentUserUtils {
Utils.DRAG_THRESHOLD = NumCast(doc["constants-dragThreshold"]);
this.setupDefaultIconTemplates(doc); // creates a set of icon templates triggered by the document deoration icon
this.setupDocTemplates(doc); // sets up the template menu of templates
- this.setupSharingSidebar(doc); // sets up the right sidebar collection for mobile upload documents and sharing
this.setupImportSidebar(doc);
this.setupActiveMobileMenu(doc); // sets up the current mobile menu for Dash Mobile
this.setupMenuPanel(doc);