From 12d20ab1b9b843d816bde445d9b67b3aa6abc6ae Mon Sep 17 00:00:00 2001 From: ab Date: Tue, 19 Feb 2019 18:17:17 -0500 Subject: reference created --- src/client/views/DocumentDecorations.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index b44e32c52..4f16453df 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -13,18 +13,34 @@ export class DocumentDecorations extends React.Component<{}, { value: string }> private _resizer = "" private _isPointerDown = false; @observable private _opacity = 1; + private keyinput: React.RefObject; constructor(props: Readonly<{}>) { super(props) DocumentDecorations.Instance = this this.state = { value: document.title }; this.handleChange = this.handleChange.bind(this); + this.keyinput = React.createRef(); } handleChange(event: any) { this.setState({ value: event.target.value }); + console.log("Input box has changed") }; + enterPressed(e: any) { + var key = e.keyCode || e.which; + // enter pressed + if (key == 13) { + var text = e.target.value; + if (text[0] == '#') { + console.log("hashtag"); + // TODO: Change field with switch statement + } + e.target.blur(); + } + } + @computed get Bounds(): { x: number, y: number, b: number, r: number } { return SelectionManager.SelectedDocuments().reduce((bounds, element) => { @@ -147,7 +163,7 @@ export class DocumentDecorations extends React.Component<{}, { value: string }> top: bounds.y - 20 - 20, opacity: this.opacity }}> - + {/*
{document.title}
*/}
e.preventDefault()}>
e.preventDefault()}>
-- cgit v1.2.3-70-g09d2