aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/CollectionLinearView.tsx
diff options
context:
space:
mode:
authorandrewdkim <adkim414@gmail.com>2020-01-15 17:42:41 -0500
committerandrewdkim <adkim414@gmail.com>2020-01-15 17:42:41 -0500
commit4bf88786cc8a7e617bca4eb57f7639d69be06dcd (patch)
treebb752dd27c9967809266e6784990993a9bfcc5e2 /src/client/views/CollectionLinearView.tsx
parent19be14b5807b117f477b57b9ecc7b96247bf4fef (diff)
wow this almost drove me crazy but swipey swipes on five fingers
Diffstat (limited to 'src/client/views/CollectionLinearView.tsx')
-rw-r--r--src/client/views/CollectionLinearView.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/views/CollectionLinearView.tsx b/src/client/views/CollectionLinearView.tsx
index 2262a3c0c..0a3096833 100644
--- a/src/client/views/CollectionLinearView.tsx
+++ b/src/client/views/CollectionLinearView.tsx
@@ -3,7 +3,7 @@ import { observer } from 'mobx-react';
import * as React from 'react';
import { Doc, HeightSym, WidthSym } from '../../new_fields/Doc';
import { makeInterface } from '../../new_fields/Schema';
-import { BoolCast, NumCast, StrCast } from '../../new_fields/Types';
+import { BoolCast, NumCast, StrCast, Cast } from '../../new_fields/Types';
import { emptyFunction, returnEmptyString, returnOne, returnTrue, Utils } from '../../Utils';
import { DragManager } from '../util/DragManager';
import { Transform } from '../util/Transform';
@@ -13,6 +13,7 @@ import { CollectionSubView } from './collections/CollectionSubView';
import { DocumentView } from './nodes/DocumentView';
import { documentSchema } from '../../new_fields/documentSchemas';
import { Id } from '../../new_fields/FieldSymbols';
+import { ScriptField } from '../../new_fields/ScriptField';
type LinearDocument = makeInterface<[typeof documentSchema,]>;
@@ -76,6 +77,9 @@ export class CollectionLinearView extends CollectionSubView(LinearDocument) {
const nativeWidth = NumCast(pair.layout.nativeWidth, this.dimension());
const deltaSize = nativeWidth * .15 / 2;
const isSelected = this._selectedIndex === ind;
+ if (isSelected) {
+ Cast(pair.layout.proto?.onPointerDown, ScriptField)?.script.run({ this: pair.layout.proto }, console.log);
+ }
return <div className={`collectionLinearView-docBtn` + (pair.layout.onClick || pair.layout.onDragStart ? "-scalable" : "")} key={pair.layout[Id]} ref={dref}
style={{
width: nested ? pair.layout[WidthSym]() : this.dimension() - deltaSize,