aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/SearchBox.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-05-22 19:51:49 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-05-22 19:51:49 -0400
commit30fdae9e869e0f132c76b4fa99b784e75d6c8dae (patch)
tree01a86e92ed6cad6a0a9a6d8adea2e09dcc2f96be /src/client/views/SearchBox.tsx
parentfe9dbb871d613d6a55873bd317d0d1af13a50ad8 (diff)
A bunch of fixes/changes
Diffstat (limited to 'src/client/views/SearchBox.tsx')
-rw-r--r--src/client/views/SearchBox.tsx10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/client/views/SearchBox.tsx b/src/client/views/SearchBox.tsx
index 911fc8d9c..fa9462acf 100644
--- a/src/client/views/SearchBox.tsx
+++ b/src/client/views/SearchBox.tsx
@@ -21,6 +21,7 @@ import { DocumentManager } from '../util/DocumentManager';
import { SetupDrag } from '../util/DragManager';
import { Docs } from '../documents/Documents';
import { RouteStore } from '../../server/RouteStore';
+import { NumCast } from '../../new_fields/Types';
library.add(faSearch);
library.add(faObjectGroup);
@@ -143,18 +144,21 @@ export class SearchBox extends React.Component {
});
let x = 0;
let y = 0;
+ let maxy = 300;
for (const doc of docs) {
doc.x = x;
doc.y = y;
doc.width = 200;
- doc.height = 200;
+ doc.height = 200 * NumCast(doc.nativeHeight) / NumCast(doc.nativeWidth, 1);
+ maxy = Math.max(doc.height, maxy);
x += 250;
if (x > 1000) {
+ maxy = 300;
x = 0;
- y += 250;
+ y += maxy + 25;
}
}
- return Docs.FreeformDocument(docs, { width: 400, height: 400, panX: 175, panY: 175, title: `Search Docs: "${this.searchString}"` });
+ return Docs.FreeformDocument(docs, { width: 400, height: 400, panX: 175, panY: 175, backgroundColor: "grey", title: `Search Docs: "${this.searchString}"` });
}
// Useful queries: