aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/util/DragManager.ts3
-rw-r--r--src/client/views/ContextMenu.scss2
-rw-r--r--src/client/views/DocumentDecorations.scss33
-rw-r--r--src/client/views/Main.scss2
-rw-r--r--src/client/views/_global_variables.scss11
-rw-r--r--src/client/views/_global_variables.scss.d.ts10
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormRemoteCursors.scss24
-rw-r--r--src/client/views/collections/collectionFreeForm/CollectionFreeFormRemoteCursors.tsx32
8 files changed, 56 insertions, 61 deletions
diff --git a/src/client/util/DragManager.ts b/src/client/util/DragManager.ts
index b8a35a4d1..e500b0274 100644
--- a/src/client/util/DragManager.ts
+++ b/src/client/util/DragManager.ts
@@ -6,6 +6,7 @@ import { DocumentDecorations } from "../views/DocumentDecorations";
import { DocumentView } from "../views/nodes/DocumentView";
import { returnFalse, emptyFunction } from "../../Utils";
import { Main } from "../views/Main";
+import globalStyles from '../views/_global_variables.scss';
export function setupDrag(_reference: React.RefObject<HTMLDivElement>, docFunc: () => Document, moveFunc?: DragManager.MoveFunction, copyOnDrop: boolean = false) {
let onRowMove = action((e: PointerEvent): void => {
@@ -177,7 +178,7 @@ export namespace DragManager {
dragElement.style.bottom = "";
dragElement.style.left = "0";
dragElement.style.transformOrigin = "0 0";
- dragElement.style.zIndex = "1000";
+ dragElement.style.zIndex = "1000";// globalStyles.contextMenuZindex.toString();
dragElement.style.transform = `translate(${x}px, ${y}px) scale(${scaleX}, ${scaleY})`;
dragElement.style.width = `${rect.width / scaleX}px`;
dragElement.style.height = `${rect.height / scaleY}px`;
diff --git a/src/client/views/ContextMenu.scss b/src/client/views/ContextMenu.scss
index f6830d9cd..5acf598cf 100644
--- a/src/client/views/ContextMenu.scss
+++ b/src/client/views/ContextMenu.scss
@@ -2,7 +2,7 @@
.contextMenu-cont {
position: absolute;
display: flex;
- z-index: 1000;
+ z-index: $contextMenu-zindex;
box-shadow: $intermediate-color 0.2vw 0.2vw 0.4vw;
flex-direction: column;
}
diff --git a/src/client/views/DocumentDecorations.scss b/src/client/views/DocumentDecorations.scss
index b2096bccb..321bda384 100644
--- a/src/client/views/DocumentDecorations.scss
+++ b/src/client/views/DocumentDecorations.scss
@@ -8,7 +8,7 @@
top: 0;
left:0;
display: grid;
- z-index: 1000;
+ z-index: $docDecorations-zindex;
grid-template-rows: 20px 8px 1fr 8px;
grid-template-columns: 8px 8px 1fr 8px 8px;
pointer-events: none;
@@ -93,37 +93,6 @@
opacity: 0.1;
}
-// position: absolute;
-// display: grid;
-// z-index: 1000;
-// grid-template-rows: 20px 1fr 20px 0px;
-// grid-template-columns: 20px 1fr 20px;
-// pointer-events: none;
-// #documentDecorations-centerCont {
-// background: none;
-// }
-// .documentDecorations-resizer {
-// pointer-events: auto;
-// background: lightblue;
-// opacity: 0.4;
-// }
-// #documentDecorations-topLeftResizer,
-// #documentDecorations-bottomRightResizer {
-// cursor: nwse-resize;
-// }
-// #documentDecorations-topRightResizer,
-// #documentDecorations-bottomLeftResizer {
-// cursor: nesw-resize;
-// }
-// #documentDecorations-topResizer,
-// #documentDecorations-bottomResizer {
-// cursor: ns-resize;
-// }
-// #documentDecorations-leftResizer,
-// #documentDecorations-rightResizer {
-// cursor: ew-resize;
-// }
-// }
.linkFlyout {
grid-column: 1/4;
margin-left: 25px;
diff --git a/src/client/views/Main.scss b/src/client/views/Main.scss
index a68b90dd4..7329b8eb6 100644
--- a/src/client/views/Main.scss
+++ b/src/client/views/Main.scss
@@ -176,7 +176,7 @@ button:hover {
overflow: visible;
top: 0;
left: 0;
- z-index: 1000;
+ z-index: $mainTextInput-zindex;
.formattedTextBox-cont {
background-color: rgba(248, 6, 6, 0.001);
width: 100%;
diff --git a/src/client/views/_global_variables.scss b/src/client/views/_global_variables.scss
index 44a819b79..238351a77 100644
--- a/src/client/views/_global_variables.scss
+++ b/src/client/views/_global_variables.scss
@@ -15,3 +15,14 @@ $sans-serif: "Noto Sans", sans-serif;
$serif: "Crimson Text", serif;
// misc values
$border-radius: 0.3em;
+//
+
+ // dragged items
+$contextMenu-zindex: 1000; // context menu shows up over everything
+$mainTextInput-zindex: 999; // then text input overlay so that it's context menu will appear over decorations, etc
+$docDecorations-zindex: 998; // then doc decorations appear over everything else
+$remoteCursors-zindex: 997; // ... not sure what level the remote cursors should go -- is this right?
+
+:export {
+ contextMenuZindex: $contextMenu-zindex
+} \ No newline at end of file
diff --git a/src/client/views/_global_variables.scss.d.ts b/src/client/views/_global_variables.scss.d.ts
new file mode 100644
index 000000000..12008aeef
--- /dev/null
+++ b/src/client/views/_global_variables.scss.d.ts
@@ -0,0 +1,10 @@
+export interface I_globalScss {
+ contextMenuZindex: number; // context menu shows up over everything
+ mainTextInputZindex: number; // then text input overlay so that it's context menu will appear over decorations, etc
+ docDecorationsZindex: number; // then doc decorations appear over everything else
+ remoteCursorsZindex: number; // ... not sure what level the remote cursors should go -- is this right?
+}
+
+export const globalStyles: I_globalScss;
+
+export default globalStyles; \ No newline at end of file
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormRemoteCursors.scss b/src/client/views/collections/collectionFreeForm/CollectionFreeFormRemoteCursors.scss
new file mode 100644
index 000000000..c38787802
--- /dev/null
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormRemoteCursors.scss
@@ -0,0 +1,24 @@
+@import "global_variables";
+
+.collectionFreeFormRemoteCursors-cont {
+
+ position:absolute;
+ z-index: $remoteCursors-zindex;
+ transform-origin: 'center center';
+}
+.collectionFreeFormRemoteCursors-canvas {
+
+ position:absolute;
+ width: 20px;
+ height: 20px;
+ opacity: 0.5;
+ border-radius: 50%;
+ border: 2px solid black;
+}
+.collectionFreeFormRemoteCursors-symbol {
+ font-size: 14;
+ color: black;
+ // fontStyle: "italic",
+ margin-left: -12;
+ margin-top: 4;
+} \ No newline at end of file
diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormRemoteCursors.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormRemoteCursors.tsx
index fc832264d..751ea8190 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormRemoteCursors.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormRemoteCursors.tsx
@@ -59,37 +59,17 @@ export class CollectionFreeFormRemoteCursors extends React.Component<CollectionV
let point = entry.Data[1];
this.drawCrosshairs("#" + v5(id, v5.URL).substring(0, 6).toUpperCase() + "22");
return (
- <div
- key={id}
- style={{
- position: "absolute",
- transform: `translate(${point[0] - 10}px, ${point[1] - 10}px)`,
- zIndex: 10000,
- transformOrigin: 'center center',
- }}
+ <div key={id} className="collectionFreeFormRemoteCursors-cont"
+ style={{ transform: `translate(${point[0] - 10}px, ${point[1] - 10}px)` }}
>
- <canvas
+ <canvas className="collectionFreeFormRemoteCursors-canvas"
ref={(el) => { if (el) this.crosshairs = el; }}
width={20}
height={20}
- style={{
- position: 'absolute',
- width: "20px",
- height: "20px",
- opacity: 0.5,
- borderRadius: "50%",
- border: "2px solid black"
- }}
/>
- <p
- style={{
- fontSize: 14,
- color: "black",
- // fontStyle: "italic",
- marginLeft: -12,
- marginTop: 4
- }}
- >{email[0].toUpperCase()}</p>
+ <p className="collectionFreeFormRemoteCursors-symbol">
+ {email[0].toUpperCase()}
+ </p>
</div>
);
}