aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/collections/CollectionSchemaCells.tsx
diff options
context:
space:
mode:
authorab <abdullah_ahmed@brown.edu>2019-09-16 15:52:49 -0400
committerab <abdullah_ahmed@brown.edu>2019-09-16 15:52:49 -0400
commit4d3e0171faaf6bdce40cc56e93f6e4bf900acf47 (patch)
tree7cb9d22fc1516202dd590542b6823c8e4a776af1 /src/client/views/collections/CollectionSchemaCells.tsx
parent9119505f608d40062a0a6f0c0a1b7db61262a5f0 (diff)
parent19375927c677ad6c99c77d0c7dac17fe7a2712a9 (diff)
merged
Diffstat (limited to 'src/client/views/collections/CollectionSchemaCells.tsx')
-rw-r--r--src/client/views/collections/CollectionSchemaCells.tsx16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionSchemaCells.tsx b/src/client/views/collections/CollectionSchemaCells.tsx
index 9c26a08f0..bf8c4b6f7 100644
--- a/src/client/views/collections/CollectionSchemaCells.tsx
+++ b/src/client/views/collections/CollectionSchemaCells.tsx
@@ -27,6 +27,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { SchemaHeaderField } from "../../../new_fields/SchemaHeaderField";
import { KeyCodes } from "../../northstar/utils/KeyCodes";
import { undoBatch } from "../../util/UndoManager";
+import { List } from "lodash";
library.add(faExpand);
@@ -86,10 +87,23 @@ export class CollectionSchemaCell extends React.Component<CellProps> {
}
@action
- onPointerDown = (e: React.PointerEvent): void => {
+ onPointerDown = async (e: React.PointerEvent): Promise<void> => {
this.props.changeFocusedCellByIndex(this.props.row, this.props.col);
this.props.setPreviewDoc(this.props.rowProps.original);
+ const data = await DocListCastAsync(this.props.Document.data);
+ if (data) {
+ let url: string;
+ if (url = StrCast(data[0].href)) {
+ try {
+ new URL(url);
+ const temp = window.open(url)!;
+ temp.blur();
+ window.focus();
+ } catch { }
+ }
+ }
+
// this._isEditing = true;
// this.props.setIsEditing(true);