Skip to content

Commit

Permalink
fix: added goto, starting ffrom 1 for find geneontology/noctua-annota…
Browse files Browse the repository at this point in the history
  • Loading branch information
tmushayahama committed Dec 8, 2020
1 parent 042220f commit cf8da20
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/@noctua.search/services/noctua-review-search.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export class NoctuaReviewSearchService {
// this.cams = response;
this.matchedCountCursor = 0;
this.calculateMatched();
this.findNext();
this.goto(0);
});

const element = document.querySelector('#noc-review-results');
Expand Down Expand Up @@ -166,6 +166,22 @@ export class NoctuaReviewSearchService {
return this.currentMatchedEnity;
}

goto(step: number) {
if (this.matchedCount === 0) {
return;
}

this.matchedCountCursor = step;
this.currentMatchedEnity = this.matchedEntities[this.matchedCountCursor];
this.camsService.expandMatch(this.currentMatchedEnity.uuid);
this.camsService.selectedNodeUuid = this.currentMatchedEnity.uuid;
this.camsService.selectedCamUuid = this.currentMatchedEnity.modelId;

this.noctuaSearchMenuService.scrollTo('#' + this.currentMatchedEnity.annotonDisplayId);

return this.currentMatchedEnity;
}

replaceAll(replaceWith): Observable<any> {
return this.camsService.replace(this.matchedEntities, replaceWith);
}
Expand Down

0 comments on commit cf8da20

Please sign in to comment.