From 3c83787b8c55663484bee4b6fb03a6bc86d7fc49 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Fri, 24 Jul 2020 00:08:21 -0500 Subject: added universal settings options --- src/client/views/DocumentButtonBar.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/client/views/DocumentButtonBar.tsx') diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx index c99034d81..2eabea8ef 100644 --- a/src/client/views/DocumentButtonBar.tsx +++ b/src/client/views/DocumentButtonBar.tsx @@ -281,7 +281,7 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV {DocumentLinksButton.StartLink ?
: null} -
+ {/*
{this.templateButton}
@@ -289,16 +289,16 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
{this.contextButton} -
+
*/}
{this.pinButton}
-
+ {/*
{this.considerGoogleDocsPush}
{this.considerGoogleDocsPull} -
+
*/} ; } } -- cgit v1.2.3-70-g09d2 From a63200e21d6304ef347a5a123839cd06ac04ec72 Mon Sep 17 00:00:00 2001 From: anika-ahluwalia Date: Mon, 3 Aug 2020 12:28:25 -0500 Subject: menu button fix and link greyed out --- src/client/views/DocumentButtonBar.tsx | 4 ++-- src/client/views/MainView.tsx | 22 ++++++++++++++++++---- src/client/views/nodes/DocumentLinksButton.tsx | 18 ++++++++++++------ src/client/views/nodes/FontIconBox.scss | 24 ++++++++++++++---------- src/client/views/nodes/FontIconBox.tsx | 12 ++++++------ 5 files changed, 52 insertions(+), 28 deletions(-) (limited to 'src/client/views/DocumentButtonBar.tsx') diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx index 23a3e1684..c9f380737 100644 --- a/src/client/views/DocumentButtonBar.tsx +++ b/src/client/views/DocumentButtonBar.tsx @@ -278,9 +278,9 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
- {DocumentLinksButton.StartLink ?
+
-
: null} +
{/*
{this.templateButton}
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index 09980ce97..8ee34a4b0 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -384,12 +384,26 @@ export class MainView extends React.Component { @action onFlyoutPointerDown = (e: React.PointerEvent) => { - this.panelContent = "none"; if (this._flyoutTranslate) { setupMoveUpEvents(this, e, action((e: PointerEvent) => { this.flyoutWidth = Math.max(e.clientX, 0); + if (this.flyoutWidth < 5) { + this.panelContent = "none"; + this._lastButton && (this._lastButton.color = "white"); + this._lastButton && (this._lastButton._backgroundColor = ""); + } return false; - }), emptyFunction, action(() => this.flyoutWidth = this.flyoutWidth < 15 ? 250 : 0)); + }), emptyFunction, this.openCloseFlyout); + } + } + + @action + openCloseFlyout = () => { + this.flyoutWidth = this.flyoutWidth < 15 ? 250 : 0; + if (this.flyoutWidth < 15) { + this.panelContent = "none"; + this._lastButton && (this._lastButton.color = "white"); + this._lastButton && (this._lastButton._backgroundColor = ""); } } @@ -480,8 +494,8 @@ export class MainView extends React.Component { @action @undoBatch closeFlyout = () => { - // this._lastButton && (this._lastButton.color = "white"); - // this._lastButton && (this._lastButton._backgroundColor = ""); + this._lastButton && (this._lastButton.color = "white"); + this._lastButton && (this._lastButton._backgroundColor = ""); this.panelContent = "none"; this.flyoutWidth = 0; } diff --git a/src/client/views/nodes/DocumentLinksButton.tsx b/src/client/views/nodes/DocumentLinksButton.tsx index 9395ac961..31efaaaa6 100644 --- a/src/client/views/nodes/DocumentLinksButton.tsx +++ b/src/client/views/nodes/DocumentLinksButton.tsx @@ -4,7 +4,7 @@ import { action, computed, observable, runInAction } from "mobx"; import { observer } from "mobx-react"; import { Doc } from "../../../fields/Doc"; import { TraceMobx } from "../../../fields/util"; -import { emptyFunction, returnFalse, setupMoveUpEvents } from "../../../Utils"; +import { emptyFunction, returnFalse, setupMoveUpEvents, emptyPath } from "../../../Utils"; import { DocUtils } from "../../documents/Documents"; import { DragManager } from "../../util/DragManager"; import { LinkManager } from "../../util/LinkManager"; @@ -202,9 +202,15 @@ export class DocumentLinksButton extends React.Component - {DocumentLinksButton.StartLink && this.props.InMenu && !this.props.StartLink && DocumentLinksButton.StartLink !== this.props.View ?
this.finishLinkClick(e.screenX, e.screenY)} /> : (null)} + {this.props.InMenu && !this.props.StartLink && + DocumentLinksButton.StartLink !== this.props.View ?
DocumentLinksButton.StartLink ? this.finishLinkClick(e.screenX, e.screenY) : emptyFunction} /> : (null)} {DocumentLinksButton.StartLink === this.props.View && this.props.InMenu && this.props.StartLink ?
; return (!links.length) && !this.props.AlwaysOn ? (null) : - this.props.InMenu ? + this.props.InMenu && (this.props.StartLink || DocumentLinksButton.StartLink) ?
{title}
}> {linkButton} -
: !!!DocumentLinksButton.EditLink ? + : !!!DocumentLinksButton.EditLink && !this.props.InMenu ?
{title}
}> {linkButton}
: diff --git a/src/client/views/nodes/FontIconBox.scss b/src/client/views/nodes/FontIconBox.scss index 31bc471de..5bdafd857 100644 --- a/src/client/views/nodes/FontIconBox.scss +++ b/src/client/views/nodes/FontIconBox.scss @@ -1,5 +1,3 @@ - - .fontIconBox-label { color: white; margin-right: 4px; @@ -12,30 +10,36 @@ border-radius: 8px; margin-top: -8px; padding: 0; - width: 100%; + width: 100%; } .menuButton-round { border-radius: 100%; + .fontIconBox-label { margin-left: -10px; // button padding is 10px; - bottom:0; + bottom: 0; position: absolute; } } + .menuButton-square { padding-top: 3px; padding-bottom: 3px; padding-left: 5px; + .fontIconBox-label { border-radius: 0px; margin-top: 0px; border-radius: "inherit"; } } -.menuButton, .menuButton-round, .menuButton-square{ + +.menuButton, +.menuButton-round, +.menuButton-square { width: 100%; - height:100%; + height: 100%; pointer-events: all; touch-action: none; @@ -43,10 +47,10 @@ touch-action: none; border-radius: 8px; - &:hover { - background: rgb(61, 61, 61); - cursor: pointer; - } + // &:hover { + // background: rgb(61, 61, 61); + // cursor: pointer; + // } } .menuButton-icon-square { diff --git a/src/client/views/nodes/FontIconBox.tsx b/src/client/views/nodes/FontIconBox.tsx index 3561d22b6..eff5a4160 100644 --- a/src/client/views/nodes/FontIconBox.tsx +++ b/src/client/views/nodes/FontIconBox.tsx @@ -12,7 +12,6 @@ import { Doc } from '../../../fields/Doc'; import { ContextMenu } from '../ContextMenu'; import { ScriptField } from '../../../fields/ScriptField'; import { Tooltip } from '@material-ui/core'; -import { CurrentUserUtils } from '../../util/CurrentUserUtils'; const FontIconSchema = createSchema({ icon: "string", }); @@ -66,11 +65,12 @@ export class FontIconBox extends DocComponent( const shape = StrCast(this.layoutDoc.iconShape, "round"); const button = <> ; return !this.layoutDoc.toolTip ? button : -- cgit v1.2.3-70-g09d2