From d50415122ea6d4b87f1604fa4611553103fa2c18 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Wed, 25 Mar 2020 20:57:22 -0400 Subject: set max size for tab titles. fixed collection sizing when filter is expanded. fixed pivot view text height when small collection. --- src/client/views/collections/CollectionView.tsx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/client/views/collections/CollectionView.tsx') diff --git a/src/client/views/collections/CollectionView.tsx b/src/client/views/collections/CollectionView.tsx index 2036a0ba9..2386f2d5d 100644 --- a/src/client/views/collections/CollectionView.tsx +++ b/src/client/views/collections/CollectionView.tsx @@ -196,7 +196,7 @@ export class CollectionView extends Touchable { private SubView = (type: CollectionViewType, renderProps: CollectionRenderProps) => { // currently cant think of a reason for collection docking view to have a chrome. mind may change if we ever have nested docking views -syip const chrome = this.props.Document._chromeStatus === "disabled" || this.props.Document._chromeStatus === "replaced" || type === CollectionViewType.Docking ? (null) : - ; + ; return [chrome, this.SubViewHelper(type, renderProps)]; } @@ -278,9 +278,9 @@ export class CollectionView extends Touchable { } @observable _facetWidth = 0; - bodyPanelWidth = () => this.props.PanelWidth() - this._facetWidth; - getTransform = () => this.props.ScreenToLocalTransform().translate(-this._facetWidth, 0); - facetWidth = () => this._facetWidth; + bodyPanelWidth = () => this.props.PanelWidth() - this.facetWidth(); + getTransform = () => this.props.ScreenToLocalTransform().translate(-this.facetWidth(), 0); + facetWidth = () => Math.min(this.props.PanelWidth() - 25, this._facetWidth); @computed get dataDoc() { return (this.props.DataDoc && this.props.Document.isTemplateForField ? Doc.GetProto(this.props.DataDoc) : @@ -385,7 +385,7 @@ export class CollectionView extends Touchable { setupMoveUpEvents(this, e, action((e: PointerEvent, down: number[], delta: number[]) => { this._facetWidth = Math.max(this.props.ScreenToLocalTransform().transformPoint(e.clientX, 0)[0], 0); return false; - }), returnFalse, action(() => this._facetWidth = this._facetWidth < 15 ? 200 : 0)); + }), returnFalse, action(() => this._facetWidth = this.facetWidth() < 15 ? Math.min(this.props.PanelWidth() - 25, 200) : 0)); } filterBackground = () => "dimGray"; @computed get scriptField() { @@ -395,7 +395,7 @@ export class CollectionView extends Touchable { @computed get filterView() { const facetCollection = this.props.Document; const flyout = ( -
e.stopPropagation()}> +
e.stopPropagation()}> {this._allFacets.map(facet =>
); return !this._facetWidth || this.props.dontRegisterView ? (null) : -
-
e.stopPropagation()}> +
+
e.stopPropagation()}>
Facet Filters @@ -452,7 +452,9 @@ export class CollectionView extends Touchable { }} onContextMenu={this.onContextMenu}> {this.showIsTagged()} - {this.collectionViewType !== undefined ? this.SubView(this.collectionViewType, props) : (null)} +
+ {this.collectionViewType !== undefined ? this.SubView(this.collectionViewType, props) : (null)} +
{this.lightbox(DocListCast(this.props.Document[this.props.fieldKey]).filter(d => d.type === DocumentType.IMG).map(d => Cast(d.data, ImageField) ? (Cast(d.data, ImageField)!.url.href.indexOf(window.location.origin) === -1) ? @@ -460,7 +462,7 @@ export class CollectionView extends Touchable { : ""))} {!this.props.isSelected() || this.props.PanelHeight() < 100 ? (null) : -
+
} -- cgit v1.2.3-70-g09d2