Scroll to the top after new search

This commit is contained in:
Geomitron
2020-05-28 18:27:45 -04:00
parent 58a0116662
commit 7e4d1a554a

View File

@@ -19,7 +19,6 @@ export class BrowseComponent implements AfterViewInit {
ngAfterViewInit() {
const $tableColumn = $('#table-column')
// TODO: on new search, scroll to the top
$tableColumn.on('scroll', () => {
const pos = $tableColumn[0].scrollTop + $tableColumn[0].offsetHeight
const max = $tableColumn[0].scrollHeight
@@ -27,5 +26,9 @@ export class BrowseComponent implements AfterViewInit {
this.searchService.updateScroll()
}
})
this.searchService.onNewSearch(() => {
$tableColumn.scrollTop(0)
})
}
}