aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/MainView.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2020-07-30 01:44:17 -0400
committerBob Zeleznik <zzzman@gmail.com>2020-07-30 01:44:17 -0400
commit140f25e109a0e6701bd652a54c1574628c220c90 (patch)
tree6d916e0044a5d5fba1ac1e298b03e573bf8068d1 /src/client/views/MainView.tsx
parent31685e36d1f7e6a95fd5d65c55562f51bfe723e1 (diff)
parent4224ebd13aec9e01f1fe73c935c40adb089dbc69 (diff)
fixed up left sidebar menu
Diffstat (limited to 'src/client/views/MainView.tsx')
-rw-r--r--src/client/views/MainView.tsx20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index 27d1da389..af4f1978e 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -59,6 +59,7 @@ import { TaskCompletionBox } from './nodes/TaskCompletedBox';
import { OverlayView } from './OverlayView';
import PDFMenu from './pdf/PDFMenu';
import { PreviewCursor } from './PreviewCursor';
+import { undoBatch } from '../util/UndoManager';
@observer
export class MainView extends React.Component {
@@ -424,10 +425,16 @@ export class MainView extends React.Component {
//sidebarScreenToLocal = () => new Transform(0, (RichTextMenu.Instance.Pinned ? -35 : 0) + (CollectionMenu.Instance.Pinned ? -35 : 0), 1);
mainContainerXf = () => this.sidebarScreenToLocal().translate(0, -this._buttonBarHeight);
+ @computed get closePosition() { return 55 + this.flyoutWidth }
@computed get flyout() {
if (!this.sidebarContent) return null;
return <div className="mainView-libraryFlyout">
<div className="mainView-contentArea" style={{ position: "relative", height: `100%`, width: "100%", overflow: "visible" }}>
+ {this.flyoutWidth > 0 ? <div className="mainView-libraryFlyout-close"
+ onPointerDown={this.closeFlyout}>
+ <FontAwesomeIcon icon="times" color="black" size="sm" />
+ </div> : null}
+
<DocumentView
Document={this.sidebarContent}
DataDoc={undefined}
@@ -578,7 +585,16 @@ export class MainView extends React.Component {
// </div>;
// }
- @action
+
+ @action @undoBatch
+ closeFlyout = () => {
+ this.panelContent = "none";
+ this.flyoutWidth = 0;
+ }
+
+ get groupManager() { return GroupManager.Instance; }
+
+ @action @undoBatch
selectMenu = (str: string) => {
if (this.panelContent === str && this.flyoutWidth !== 0) {
this.panelContent = "none";
@@ -597,7 +613,7 @@ export class MainView extends React.Component {
return true;
}
- @action
+ @action @undoBatch
onDown = (e: React.PointerEvent) => {
setupMoveUpEvents(this, e, action((e: PointerEvent, down: number[], delta: number[]) => {
this._propertiesWidth = this._panelWidth - Math.max(Transform.Identity().transformPoint(e.clientX, 0)[0], 0);