aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/search
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-06-30 16:04:52 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-06-30 16:04:52 -0400
commit13fcbc4c500fec36e69cac4fc3c0ca6822322809 (patch)
treec12447b98dd0511b43ee3f60222fcede4d310816 /src/client/views/search
parent9dd5db438c80da77b6d791787263425c0d378933 (diff)
Fixed errors and linter warnings
Diffstat (limited to 'src/client/views/search')
-rw-r--r--src/client/views/search/FilterBox.tsx7
-rw-r--r--src/client/views/search/SearchItem.tsx15
2 files changed, 11 insertions, 11 deletions
diff --git a/src/client/views/search/FilterBox.tsx b/src/client/views/search/FilterBox.tsx
index c39ec1145..8bbbf3012 100644
--- a/src/client/views/search/FilterBox.tsx
+++ b/src/client/views/search/FilterBox.tsx
@@ -65,9 +65,9 @@ export class FilterBox extends React.Component {
setupAccordion() {
$('document').ready(function () {
- var acc = document.getElementsByClassName('filter-header');
-
- for (var i = 0; i < acc.length; i++) {
+ const acc = document.getElementsByClassName('filter-header');
+ // tslint:disable-next-line: prefer-for-of
+ for (let i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function (this: HTMLElement) {
this.classList.toggle("active");
@@ -96,6 +96,7 @@ export class FilterBox extends React.Component {
$('document').ready(function () {
var acc = document.getElementsByClassName('filter-header');
+ // tslint:disable-next-line: prefer-for-of
for (var i = 0; i < acc.length; i++) {
let classList = acc[i].classList;
if (classList.contains("active")) {
diff --git a/src/client/views/search/SearchItem.tsx b/src/client/views/search/SearchItem.tsx
index b72f8c814..f8a0c7b16 100644
--- a/src/client/views/search/SearchItem.tsx
+++ b/src/client/views/search/SearchItem.tsx
@@ -83,9 +83,8 @@ export class SelectorContextMenu extends React.Component<SearchItemProps> {
<FontAwesomeIcon icon={faStickyNote} />
</div>
<a className="title" onClick={this.getOnClick(doc)}>{doc.col.title}</a>
- </div>
- }
- )}
+ </div>;
+ })}
</div>
);
}
@@ -111,7 +110,7 @@ export class SearchItem extends React.Component<SearchItemProps> {
if (layoutresult.indexOf(DocTypes.COL) !== -1) {
renderDoc = Doc.MakeDelegate(renderDoc);
let bounds = DocListCast(renderDoc.data).reduce((bounds, doc) => {
- var [sptX, sptY] = [NumCast(doc.x), NumCast(doc.y)]
+ var [sptX, sptY] = [NumCast(doc.x), NumCast(doc.y)];
let [bptX, bptY] = [sptX + doc[WidthSym](), sptY + doc[HeightSym]()];
return {
x: Math.min(sptX, bounds.x), y: Math.min(sptY, bounds.y),
@@ -124,7 +123,7 @@ export class SearchItem extends React.Component<SearchItemProps> {
let returnYDimension = () => this._displayDim;
let scale = () => returnXDimension() / NumCast(renderDoc.nativeWidth, returnXDimension());
return <div
- onPointerDown={action(() => { this._useIcons = !this._useIcons; this._displayDim = this._useIcons ? 50 : Number(SEARCH_THUMBNAIL_SIZE) })}
+ onPointerDown={action(() => { this._useIcons = !this._useIcons; this._displayDim = this._useIcons ? 50 : Number(SEARCH_THUMBNAIL_SIZE); })}
onPointerEnter={action(() => this._displayDim = this._useIcons ? 50 : Number(SEARCH_THUMBNAIL_SIZE))}
onPointerLeave={action(() => this._displayDim = 50)} >
<DocumentView
@@ -147,7 +146,7 @@ export class SearchItem extends React.Component<SearchItemProps> {
ContainingCollectionView={undefined}
ContentScaling={scale}
/>
- </div>
+ </div>;
}
let button = layoutresult.indexOf(DocTypes.PDF) !== -1 ? faFilePdf :
@@ -160,7 +159,7 @@ export class SearchItem extends React.Component<SearchItemProps> {
layoutresult.indexOf(DocTypes.HIST) !== -1 ? faChartBar :
layoutresult.indexOf(DocTypes.WEB) !== -1 ? faGlobeAsia :
faCaretUp;
- return <div onPointerDown={action(() => { this._useIcons = false; this._displayDim = Number(SEARCH_THUMBNAIL_SIZE) })} >
+ return <div onPointerDown={action(() => { this._useIcons = false; this._displayDim = Number(SEARCH_THUMBNAIL_SIZE); })} >
<FontAwesomeIcon icon={button} size="2x" />
</div>;
}
@@ -189,7 +188,7 @@ export class SearchItem extends React.Component<SearchItemProps> {
}
@action
- pointerDown = (e: React.PointerEvent) => SearchBox.Instance.openSearch(e);
+ pointerDown = (e: React.PointerEvent) => SearchBox.Instance.openSearch(e)
highlightDoc = (e: React.PointerEvent) => {
if (this.props.doc.type === DocTypes.LINK) {