From a0c15d84b6d5f1aff604b755ec31c66dd341b235 Mon Sep 17 00:00:00 2001 From: Andy Rickert Date: Tue, 16 Jun 2020 12:56:54 -0400 Subject: seachitem ui --- src/client/views/search/SearchItem.tsx | 39 ++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/client/views/search/SearchItem.tsx b/src/client/views/search/SearchItem.tsx index c1fd2d0b8..0c4ddf038 100644 --- a/src/client/views/search/SearchItem.tsx +++ b/src/client/views/search/SearchItem.tsx @@ -180,8 +180,10 @@ export class SearchItem extends ViewBoxBaseComponent this._displayLines, el=> { - setTimeout(() =>(this._mainRef.current?.getBoundingClientRect()? this.props.Document._height= this._mainRef.current?.getBoundingClientRect().height : null), 1); + if (this.rootDoc.parent){ + parent = Cast(this.rootDoc.parent, Doc, null) as Doc; + height=(NumCast(parent._height)); + }; + setTimeout(() =>{this._mainRef.current?.getBoundingClientRect()? this.props.Document._height= this._mainRef.current?.getBoundingClientRect().height : null; + parent!==undefined? this._mainRef.current?.getBoundingClientRect()? parent._height= -this._oldHeight + height +this._mainRef.current?.getBoundingClientRect().height : null: null; + this._mainRef.current?.getBoundingClientRect()? this._oldHeight= this._mainRef.current?.getBoundingClientRect().height : null; + }, 1); } ); @@ -298,6 +307,7 @@ export class SearchItem extends ViewBoxBaseComponent { e.preventDefault(); + e.stopPropagation(); //e.button === 0 && SearchBox.Instance.openSearch(e); this.rootDoc!.searchMatch = false; @@ -311,6 +321,8 @@ export class SearchItem extends ViewBoxBaseComponent { e.preventDefault(); + e.stopPropagation(); + //e.button === 0 && SearchBox.Instance.openSearch(e); this.rootDoc!.searchMatch2 = false; @@ -447,22 +459,23 @@ export class SearchItem extends ViewBoxBaseComponent -
- {this.rootDoc!.type === DocumentType.PDF? : null} - {`Instance ${NumCast(this.rootDoc.searchIndex)===0? NumCast(this.rootDoc.length):NumCast(this.rootDoc.searchIndex) } of ${NumCast(this.rootDoc.length)}`} - -
-
+ +
+
+
{this.returnLines()}
+ } private _mainRef: React.RefObject = React.createRef(); @@ -512,7 +525,7 @@ export class SearchItem extends ViewBoxBaseComponent {this.rootDoc.highlighting? StrCast(this.rootDoc.highlighting).length ? "Matched fields:" + StrCast(this.rootDoc.highlighting) : Cast(this.rootDoc.lines, listSpec("string"))!.length ? Cast(this.rootDoc.lines, listSpec("string"))![0] : "":null}
- {NumCast(this.rootDoc.length) > 1 ?this.returnButtons(): null} + {NumCast(this.rootDoc.length) > 1 || this.rootDoc!.type === DocumentType.PDF?this.returnButtons(): null}
-- cgit v1.2.3-70-g09d2