aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-02-18 19:01:17 -0500
committerab <abdullah_ahmed@brown.edu>2019-02-18 19:01:17 -0500
commit2886c2859bfc6ad396fc4bab3e90cf18da5442f1 (patch)
treed19fd48e5bc87c936ab1b9d9991e9c4c06cc15e3 /src
parentc03e3fc75ef9ffb56cbfadb0c3164ead1fea4a40 (diff)
input title
Diffstat (limited to 'src')
-rw-r--r--src/client/views/DocumentDecorations.scss2
-rw-r--r--src/client/views/DocumentDecorations.tsx15
2 files changed, 9 insertions, 8 deletions
diff --git a/src/client/views/DocumentDecorations.scss b/src/client/views/DocumentDecorations.scss
index 5c99c52ea..9bafbda44 100644
--- a/src/client/views/DocumentDecorations.scss
+++ b/src/client/views/DocumentDecorations.scss
@@ -33,6 +33,6 @@
background: lightblue;
grid-column-start:1;
grid-column-end: 4;
- cursor: ne-resize;
+ pointer-events: auto;
}
} \ No newline at end of file
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index dcfedfcd1..b44e32c52 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -8,7 +8,7 @@ import ContentEditable from 'react-contenteditable'
import { KeyStore } from '../../fields/Key'
@observer
-export class DocumentDecorations extends React.Component {
+export class DocumentDecorations extends React.Component<{}, { value: string }> {
static Instance: DocumentDecorations
private _resizer = ""
private _isPointerDown = false;
@@ -17,12 +17,13 @@ export class DocumentDecorations extends React.Component {
constructor(props: Readonly<{}>) {
super(props)
DocumentDecorations.Instance = this
- this.state = { html: "hi" };
+ this.state = { value: document.title };
+ this.handleChange = this.handleChange.bind(this);
}
- // handleChange = evt => {
- // this.setState({ html: evt.target.value });
- // };
+ handleChange(event: any) {
+ this.setState({ value: event.target.value });
+ };
@computed
get Bounds(): { x: number, y: number, b: number, r: number } {
@@ -146,8 +147,8 @@ export class DocumentDecorations extends React.Component {
top: bounds.y - 20 - 20,
opacity: this.opacity
}}>
- {/*<input className="title" name="dynbox" value="hey" onPointerDown={this.onPointerDown} />*/}
- <div className="title" onPointerDown={this.onPointerDown}>{document.title}</div>
+ <input className="title" type="text" name="dynbox" value={this.state.value} onChange={this.handleChange} onPointerDown={this.onPointerDown} />
+ {/* <div className="title" onPointerDown={this.onPointerDown}>{document.title}</div> */}
<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>
<div id="documentDecorations-topRightResizer" className="documentDecorations-resizer" onPointerDown={this.onPointerDown} onContextMenu={(e) => e.preventDefault()}></div>