aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2020-09-14 12:49:51 -0400
committerbobzel <zzzman@gmail.com>2020-09-14 12:49:51 -0400
commit64334336e7d17f2aec3151f73e8f6dbf7cf78940 (patch)
treef887937330c96f6d7103fbda5db21c7b4fe17e1d
parent3893d4913852bd92b2a71880bb7c7cf39aba0c2c (diff)
fixed linear view to allow dropped images to be seen
-rw-r--r--src/client/views/collections/CollectionLinearView.tsx13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/client/views/collections/CollectionLinearView.tsx b/src/client/views/collections/CollectionLinearView.tsx
index 22c1f51a6..e1c7339c9 100644
--- a/src/client/views/collections/CollectionLinearView.tsx
+++ b/src/client/views/collections/CollectionLinearView.tsx
@@ -18,6 +18,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { LinkDescriptionPopup } from '../nodes/LinkDescriptionPopup';
import { Tooltip } from '@material-ui/core';
import { all } from 'bluebird';
+import { ContentFittingDocumentView } from '../nodes/ContentFittingDocumentView';
type LinearDocument = makeInterface<[typeof documentSchema,]>;
@@ -132,15 +133,15 @@ export class CollectionLinearView extends CollectionSubView(LinearDocument) {
const nested = pair.layout._viewType === CollectionViewType.Linear;
const dref = React.createRef<HTMLDivElement>();
const nativeWidth = NumCast(pair.layout._nativeWidth, this.dimension());
- const deltaSize = nativeWidth * .15 / 2;
const scalable = pair.layout.onClick || pair.layout.onDragStart;
return <div className={`collectionLinearView-docBtn` + (scalable ? "-scalable" : "")} key={pair.layout[Id]} ref={dref}
style={{
pointerEvents: "all",
- width: scalable ? (nested ? pair.layout[WidthSym]() : this.dimension() - deltaSize) : undefined,
- height: nested && pair.layout.linearViewIsExpanded ? pair.layout[HeightSym]() : this.dimension() - deltaSize,
+ minWidth: 30,
+ width: nested ? pair.layout[WidthSym]() : this.dimension(),
+ height: nested && pair.layout.linearViewIsExpanded ? pair.layout[HeightSym]() : this.dimension(),
}} >
- <DocumentView
+ <ContentFittingDocumentView
Document={pair.layout}
DataDoc={pair.data}
LibraryPath={this.props.LibraryPath}
@@ -153,8 +154,8 @@ export class CollectionLinearView extends CollectionSubView(LinearDocument) {
onClick={undefined}
ScreenToLocalTransform={this.getTransform(dref)}
ContentScaling={returnOne}
- PanelWidth={nested ? pair.layout[WidthSym] : () => this.dimension()}// ugh - need to get rid of this inline function to avoid recomputing
- PanelHeight={nested ? pair.layout[HeightSym] : () => this.dimension()}
+ PanelWidth={nested ? pair.layout[WidthSym] : this.dimension}
+ PanelHeight={nested ? pair.layout[HeightSym] : this.dimension}
renderDepth={this.props.renderDepth + 1}
focus={emptyFunction}
backgroundColor={this.props.backgroundColor}