diff options
author | Bob Zeleznik <zzzman@gmail.com> | 2019-03-21 00:57:02 -0400 |
---|---|---|
committer | Bob Zeleznik <zzzman@gmail.com> | 2019-03-21 00:57:02 -0400 |
commit | 79846f5e85c04435082106724d49b03eea31657f (patch) | |
tree | 0e09dfdddd18fa35adc8a2eb20495388b51302c5 /src | |
parent | cac21da4feeb5cebdda008011ab89bce15b01214 (diff) |
minor fix to schema dragger and treeview
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/CollectionSchemaView.tsx | 2 | ||||
-rw-r--r-- | src/client/views/collections/CollectionTreeView.tsx | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionSchemaView.tsx b/src/client/views/collections/CollectionSchemaView.tsx index c2645ea73..d3ade7ebb 100644 --- a/src/client/views/collections/CollectionSchemaView.tsx +++ b/src/client/views/collections/CollectionSchemaView.tsx @@ -189,7 +189,7 @@ export class CollectionSchemaView extends CollectionViewBase { @action onDividerMove = (e: PointerEvent): void => { let nativeWidth = this._mainCont.current!.getBoundingClientRect(); - this.props.Document.SetNumber(KeyStore.SchemaSplitPercentage, 100 - Math.round((e.clientX - nativeWidth.left) / nativeWidth.width * 100)); + this.props.Document.SetNumber(KeyStore.SchemaSplitPercentage, Math.max(0, 100 - Math.round((e.clientX - nativeWidth.left) / nativeWidth.width * 100))); } @action onDividerUp = (e: PointerEvent): void => { diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index 6edd90215..ec1bf5d0e 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -1,7 +1,7 @@ import { IconProp, library } from '@fortawesome/fontawesome-svg-core'; import { faCaretDown, faCaretRight, faTrashAlt } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { action, observable } from "mobx"; +import { action, observable, trace } from "mobx"; import { observer } from "mobx-react"; import { Document } from "../../../fields/Document"; import { FieldWaiting } from "../../../fields/Field"; @@ -90,14 +90,14 @@ class TreeView extends React.Component<TreeViewProps> { if (children && children !== FieldWaiting) { // add children for a collection if (!this._collapsed) { bulletType = BulletType.Collapsible; - childElements = <ul key={this.props.document.Id}> + childElements = <ul> {children.Data.map(value => <TreeView key={value.Id} document={value} deleteDoc={this.remove} />)} </ul> } else bulletType = BulletType.Collapsed; } return <div className="treeViewItem-container" > - <li className="collection-child" key={this.props.document.Id}> + <li className="collection-child"> {this.renderBullet(bulletType)} {this.renderTitle()} {childElements ? childElements : (null)} |