From 2583d4cd4b8a5f8b3acc3c0e0970adf295d4d8c5 Mon Sep 17 00:00:00 2001
From: usodhi <61431818+usodhi@users.noreply.github.com>
Date: Thu, 13 Aug 2020 14:50:06 +0530
Subject: location of mainviewnotifs notification bubble should be fixed +
Anika's defaultaclprivate fix
---
src/client/util/CurrentUserUtils.ts | 6 ++++++
src/client/views/MainViewNotifs.tsx | 10 +++++++++-
src/client/views/collections/CollectionStackingView.tsx | 9 ++++-----
src/client/views/collections/CollectionSubView.tsx | 2 --
4 files changed, 19 insertions(+), 8 deletions(-)
(limited to 'src')
diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts
index 11c2395ff..09876c736 100644
--- a/src/client/util/CurrentUserUtils.ts
+++ b/src/client/util/CurrentUserUtils.ts
@@ -23,6 +23,7 @@ import { SchemaHeaderField } from "../../fields/SchemaHeaderField";
import { DimUnit } from "../views/collections/collectionMulticolumn/CollectionMulticolumnView";
import { LabelBox } from "../views/nodes/LabelBox";
import { LinkManager } from "./LinkManager";
+import { Id } from "../../fields/FieldSymbols";
export class CurrentUserUtils {
private static curr_id: string;
@@ -550,6 +551,10 @@ 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 => {
@@ -909,6 +914,7 @@ export class CurrentUserUtils {
doc.fontFamily = StrCast(doc.fontFamily, "Arial");
doc.fontColor = StrCast(doc.fontColor, "black");
doc.fontHighlight = StrCast(doc.fontHighlight, "");
+ doc.defaultAclPrivate = BoolCast(doc.defaultAclPrivate, true);
doc.activeCollectionBackground = StrCast(doc.activeCollectionBackground, "white");
doc.activeCollectionNestedBackground = Cast(doc.activeCollectionNestedBackground, "string", null);
doc.noviceMode = BoolCast(doc.noviceMode, true);
diff --git a/src/client/views/MainViewNotifs.tsx b/src/client/views/MainViewNotifs.tsx
index 89006ebc8..c0cd7b3a7 100644
--- a/src/client/views/MainViewNotifs.tsx
+++ b/src/client/views/MainViewNotifs.tsx
@@ -8,6 +8,7 @@ import { DragManager } from '../util/DragManager';
import "./MainViewNotifs.scss";
import { MainView } from './MainView';
import { NumCast } from '../../fields/Types';
+import { Id } from '../../fields/FieldSymbols';
@observer
@@ -28,7 +29,14 @@ export class MainViewNotifs extends React.Component {
render() {
const length = MainViewNotifs.NotifsCol ? DocListCast(MainViewNotifs.NotifsCol.data).length : 0;
- return
+ const menuStack = Doc.UserDoc().menuStack as Doc;
+ const menuButtons = DocListCast(menuStack.data);
+ let top = 12 - NumCast(menuStack._scrollTop);
+ for (const button of menuButtons) {
+ if (button[Id] !== menuStack.sharingButtonId) top += NumCast(button._height);
+ else break;
+ }
+ return
{this.dockingContent}
-