aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbob <bcz@cs.brown.edu>2019-02-13 10:38:59 -0500
committerbob <bcz@cs.brown.edu>2019-02-13 10:38:59 -0500
commit47157f2d95ac1a9541ae313da321d050b073d0a7 (patch)
tree683e79c48cda177224748243ea5e72d58eabb2d1 /src
parent3033e4d5f26bbdb808c1a88d1ecabb57b2acade4 (diff)
more css playing. moved NodeView to DocumentView.scss
Diffstat (limited to 'src')
-rw-r--r--src/client/views/Main.tsx3
-rw-r--r--src/client/views/collections/CollectionSchemaView.scss11
-rw-r--r--src/client/views/collections/CollectionSchemaView.tsx13
-rw-r--r--src/client/views/nodes/CollectionFreeFormDocumentView.tsx5
-rw-r--r--src/client/views/nodes/DocumentView.scss (renamed from src/client/views/nodes/NodeView.scss)2
-rw-r--r--src/client/views/nodes/DocumentView.tsx6
6 files changed, 25 insertions, 15 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx
index e78949ba7..aec9618ae 100644
--- a/src/client/views/Main.tsx
+++ b/src/client/views/Main.tsx
@@ -45,12 +45,13 @@ document.addEventListener("pointerdown", action(function (e: PointerEvent) {
doc2.Set(KS.X, new NumberField(150));
doc2.Set(KS.Y, new NumberField(20));
let doc3 = Documents.ImageDocument("https://psmag.com/.image/t_share/MTMyNzc2NzM1MDY1MjgzMDM4/shutterstock_151341212jpg.jpg", {
- x: 450, y: 100, title: "cat 1", width: 606, height: 386, nativeWidth: 606, nativeHeight: 386
+ x: 450, y: 100, title: "dog", width: 606, height: 386, nativeWidth: 606, nativeHeight: 386
});
//doc3.Set(KeyStore.Data, new ImageField);
const schemaDocs = Array.from(Array(5).keys()).map(v => Documents.ImageDocument("https://psmag.com/.image/t_share/MTMyNzc2NzM1MDY1MjgzMDM4/shutterstock_151341212jpg.jpg", {
x: 50 + 100 * v, y: 50, width: 100, height: 100, title: "cat" + v, nativeWidth: 606, nativeHeight: 386
}));
+ schemaDocs.push(doc3);
schemaDocs[0].SetData(KS.Author, "Tyler", TextField);
schemaDocs[4].SetData(KS.Author, "Bob", TextField);
schemaDocs.push(doc2);
diff --git a/src/client/views/collections/CollectionSchemaView.scss b/src/client/views/collections/CollectionSchemaView.scss
index 70715c7a3..7c4726c7b 100644
--- a/src/client/views/collections/CollectionSchemaView.scss
+++ b/src/client/views/collections/CollectionSchemaView.scss
@@ -1,10 +1,17 @@
.collectionSchemaView-container {
-
+ border-style: solid;
+ box-sizing: border-box;
+ .collectionfreeformview-container {
+ border-width: 0px !important
+ }
.imageBox-cont {
position:relative;
max-height:100%;
}
+ .ReactTable {
+ position: absolute
+ }
.ReactTable .rt-th, .ReactTable .rt-td {
max-height: 75px;
}
@@ -12,7 +19,7 @@
object-fit: contain;
height: 100%
}
- .node {
+ .documentView-node {
width:100% !important;
height:100% !important;
.imageBox-cont img {
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx
index b6bdccaa9..1d045ac78 100644
--- a/src/client/views/collections/CollectionSchemaView.tsx
+++ b/src/client/views/collections/CollectionSchemaView.tsx
@@ -7,7 +7,7 @@ import { observable, action, computed } from "mobx";
import SplitPane from "react-split-pane"
import "./CollectionSchemaView.scss"
import { ScrollBox } from "../../util/ScrollBox";
-import { CollectionViewBase } from "./CollectionViewBase";
+import { CollectionViewBase, COLLECTION_BORDER_WIDTH } from "./CollectionViewBase";
import { DocumentView } from "../nodes/DocumentView";
import { EditableView } from "../EditableView";
import { CompileScript, ToField } from "../../util/Scripting";
@@ -116,8 +116,12 @@ export class CollectionSchemaView extends CollectionViewBase {
content = <div />
}
return (
- <div onPointerDown={this.onPointerDown} className="collectionSchemaView-container">
- <SplitPane split={"vertical"} defaultSize="60%">
+ <div onPointerDown={this.onPointerDown} className="collectionSchemaView-container"
+ style={{
+ borderWidth: `${COLLECTION_BORDER_WIDTH}px`,
+ }}
+ >
+ <SplitPane split={"vertical"} defaultSize="60%" style={{ position: "relative", overflow: "none" }}>
<ScrollBox>
<ReactTable
data={children}
@@ -126,7 +130,8 @@ export class CollectionSchemaView extends CollectionViewBase {
showPagination={false}
style={{
display: "inline-block",
- width: "100%"
+ width: "100%",
+ postion: "absolute"
}}
columns={columns.map(col => {
return (
diff --git a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
index 544ace075..a2fbe96d2 100644
--- a/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
+++ b/src/client/views/nodes/CollectionFreeFormDocumentView.tsx
@@ -7,11 +7,10 @@ import { SelectionManager } from "../../util/SelectionManager";
import { CollectionDockingView } from "../collections/CollectionDockingView";
import { CollectionFreeFormView } from "../collections/CollectionFreeFormView";
import { ContextMenu } from "../ContextMenu";
-import "./NodeView.scss";
+import "./DocumentView.scss";
import React = require("react");
import { DocumentView, DocumentViewProps } from "./DocumentView";
import { Transform } from "../../util/Transform";
-import { COLLECTION_BORDER_WIDTH } from '../../views/collections/CollectionViewBase';
@observer
@@ -218,7 +217,7 @@ export class CollectionFreeFormDocumentView extends DocumentView {
render() {
var parentScaling = this.nativeWidth > 0 ? this.width / this.nativeWidth : 1;
return (
- <div className="node" ref={this._mainCont}
+ <div className="documentView-node" ref={this._mainCont}
onContextMenu={this.onContextMenu}
onPointerDown={this.onPointerDown}
style={{
diff --git a/src/client/views/nodes/NodeView.scss b/src/client/views/nodes/DocumentView.scss
index dac1c0a8e..8e2ebd690 100644
--- a/src/client/views/nodes/NodeView.scss
+++ b/src/client/views/nodes/DocumentView.scss
@@ -1,4 +1,4 @@
-.node {
+.documentView-node {
position: absolute;
background: #cdcdcd;
overflow: hidden;
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index ec68e9e51..55c8121d3 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -4,8 +4,6 @@ import { Document } from "../../../fields/Document";
import { Opt, FieldWaiting } from "../../../fields/Field";
import { Key, KeyStore } from "../../../fields/Key";
import { ListField } from "../../../fields/ListField";
-import { NumberField } from "../../../fields/NumberField";
-import { TextField } from "../../../fields/TextField";
import { Utils } from "../../../Utils";
import { CollectionDockingView } from "../collections/CollectionDockingView";
import { CollectionFreeFormView } from "../collections/CollectionFreeFormView";
@@ -13,7 +11,7 @@ import { CollectionSchemaView } from "../collections/CollectionSchemaView";
import { CollectionViewBase, COLLECTION_BORDER_WIDTH } from "../collections/CollectionViewBase";
import { FormattedTextBox } from "../nodes/FormattedTextBox";
import { ImageBox } from "../nodes/ImageBox";
-import "./NodeView.scss";
+import "./DocumentView.scss";
import React = require("react");
import { Transform } from "../../util/Transform";
const JsxParser = require('react-jsx-parser').default;//TODO Why does this need to be imported like this?
@@ -177,7 +175,7 @@ export class DocumentView extends React.Component<DocumentViewProps> {
var width = nativewidth > 0 ? nativewidth + "px" : "100%";
var height = nativeheight > 0 ? nativeheight + "px" : "100%";
return (
- <div className="node" ref={this._mainCont}
+ <div className="documentView-node" ref={this._mainCont}
style={{
width: width,
height: height,