aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/DocumentDecorations.scss6
-rw-r--r--src/client/views/DocumentDecorations.tsx25
-rw-r--r--src/client/views/nodes/DocumentView.tsx14
3 files changed, 36 insertions, 9 deletions
diff --git a/src/client/views/DocumentDecorations.scss b/src/client/views/DocumentDecorations.scss
index c72623546..befe175b5 100644
--- a/src/client/views/DocumentDecorations.scss
+++ b/src/client/views/DocumentDecorations.scss
@@ -39,12 +39,16 @@
}
.title{
background: lightblue;
- grid-column-start:1;
+ grid-column-start:2;
grid-column-end: 4;
pointer-events: auto;
}
}
+.documentDecorations-minimizeButton {
+ background: rgb(250, 57, 9);
+ pointer-events: all;
+}
.documentDecorations-background {
background: lightblue;
position: absolute;
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 572c265f3..b74737ec9 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -139,11 +139,33 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
e.preventDefault();
}
+ onMinimizeDown = (e: React.PointerEvent): void => {
+ e.stopPropagation();
+ if (e.button === 0) {
+ document.removeEventListener("pointermove", this.onMinimizeMove);
+ document.addEventListener("pointermove", this.onMinimizeMove);
+ document.removeEventListener("pointerup", this.onMinimizeUp);
+ document.addEventListener("pointerup", this.onMinimizeUp);
+ }
+ }
+ onMinimizeMove = (e: PointerEvent): void => {
+ e.stopPropagation();
+ if (e.button === 0) {
+ }
+ }
+ onMinimizeUp = (e: PointerEvent): void => {
+ e.stopPropagation();
+ if (e.button === 0) {
+ SelectionManager.SelectedDocuments().map(dv => dv.minimize());
+ document.removeEventListener("pointermove", this.onMinimizeMove);
+ document.removeEventListener("pointerup", this.onMinimizeUp);
+ }
+ }
+
onPointerDown = (e: React.PointerEvent): void => {
e.stopPropagation();
if (e.button === 0) {
this._isPointerDown = true;
- console.log("Pointer down");
this._resizer = e.currentTarget.id;
document.removeEventListener("pointermove", this.onPointerMove);
document.addEventListener("pointermove", this.onPointerMove);
@@ -339,6 +361,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }>
top: bounds.y - this._resizeBorderWidth / 2 - this._titleHeight,
opacity: this._opacity
}}>
+ <div className="documentDecorations-minimizeButton" onPointerDown={this.onMinimizeDown}>v</div>
<input ref={this.keyinput} className="title" type="text" name="dynbox" value={this.getValue()} onChange={this.handleChange} onPointerDown={this.onPointerDown} onKeyPress={this.enterPressed} />
<div id="documentDecorations-topLeftResizer" className="documentDecorations-resizer" onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div>
<div id="documentDecorations-topResizer" className="documentDecorations-resizer" onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div>
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 2b9372e15..bc627015c 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -70,18 +70,18 @@ export function FakeJsxArgs(keys: string[], fields: string[] = []): JsxArgs {
let Keys: { [name: string]: any } = {};
let Fields: { [name: string]: any } = {};
for (const key of keys) {
- let fn = () => {};
+ let fn = () => { };
Object.defineProperty(fn, "name", { value: key + "Key" });
Keys[key] = fn;
}
for (const field of fields) {
- let fn = () => {};
+ let fn = () => { };
Object.defineProperty(fn, "name", { value: field });
Fields[field] = fn;
}
let args: JsxArgs = {
- Document: function Document() {},
- DocumentView: function DocumentView() {},
+ Document: function Document() { },
+ DocumentView: function DocumentView() { },
Keys,
Fields
} as any;
@@ -115,7 +115,7 @@ export class DocumentView extends React.Component<DocumentViewProps> {
return (
!this.props.ContainingCollectionView ||
this.props.ContainingCollectionView.collectionViewType ==
- CollectionViewType.Docking
+ CollectionViewType.Docking
);
}
@computed get layout(): string {
@@ -233,7 +233,7 @@ export class DocumentView extends React.Component<DocumentViewProps> {
};
DragManager.StartDocumentDrag([this._mainCont.current], dragData, {
handlers: {
- dragComplete: action(() => {})
+ dragComplete: action(() => { })
},
hideSource: !dropAliasOfDraggedDoc
});
@@ -307,7 +307,7 @@ export class DocumentView extends React.Component<DocumentViewProps> {
};
@action
- minimize = (e: React.MouseEvent): void => {
+ public minimize = (): void => {
this.props.Document.SetData(
KeyStore.Minimized,
true as boolean,