diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-02-20 21:02:17 -0500 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-02-20 21:02:17 -0500 |
commit | a4c6a84c12aee00340bc20b30fa7d19072d999ba (patch) | |
tree | 2d69b900567725e3c09fb85f8a95ca12f7712176 /src/client/views/Main.tsx | |
parent | c4a9eed08fbab61c295ec97ca1ffd7048afac3ac (diff) | |
parent | bdc798e6a966e12f574ab47cd46c9cb802aafe74 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/Main.tsx')
-rw-r--r-- | src/client/views/Main.tsx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/client/views/Main.tsx b/src/client/views/Main.tsx index 0e770cd11..2f8337d8e 100644 --- a/src/client/views/Main.tsx +++ b/src/client/views/Main.tsx @@ -16,6 +16,7 @@ import { MessageStore, DocumentTransfer } from '../../server/Message'; import { Transform } from '../util/Transform'; import { CollectionDockingView } from './collections/CollectionDockingView'; import { FieldWaiting } from '../../fields/Field'; +import { UndoManager } from '../util/UndoManager'; configure({ @@ -94,6 +95,11 @@ Documents.initProtos(() => { x: 0, y: 300, width: 200, height: 200, title: "added note" })); }) + let addSchemaNode = action(() => { + mainfreeform.GetList<Document>(KeyStore.Data, []).push(Documents.SchemaDocument([Documents.TextDocument()], { + x: 0, y: 300, width: 200, height: 200, title: "added note" + })); + }) let clearDatabase = action(() => { Utils.Emit(Server.Socket, MessageStore.DeleteAll, {}); @@ -129,10 +135,28 @@ Documents.initProtos(() => { }} onClick={addColNode}>Add Collection</button> <button style={{ position: 'absolute', + bottom: '100', + left: '0px', + width: '150px' + }} onClick={addSchemaNode}>Add Schema</button> + <button style={{ + position: 'absolute', bottom: '75px', left: '0px', width: '150px' }} onClick={clearDatabase}>Clear Database</button> + <button style={{ + position: 'absolute', + bottom: '25', + right: '0px', + width: '150px' + }} onClick={() => UndoManager.Undo()}>Undo</button> + <button style={{ + position: 'absolute', + bottom: '0', + right: '0px', + width: '150px' + }} onClick={() => UndoManager.Redo()}>Redo</button> </div>), document.getElementById('root')); }) |