IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
소스 검색

Added scrollback to top on page change in WBLiveLogs.

master
부모
커밋
47eadecf2c
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. +4
    -2
      frontend/src/js/component/wb-live-logs.js

+ 4
- 2
frontend/src/js/component/wb-live-logs.js 파일 보기

@@ -1,4 +1,4 @@
import { h, Component } from 'preact';
import { h, Component, createRef } from 'preact';
import makeArvadosRequest from 'make-arvados-request';
import WBPagination from 'wb-pagination';
@@ -6,6 +6,7 @@ class WBLiveLogs extends Component {
constructor(...args) {
super(...args);
this.state.page = 0;
this.terminalRef = createRef();
}
componentDidMount() {
@@ -39,6 +40,7 @@ class WBLiveLogs extends Component {
.map(a => a.properties.text.trim()).join('\n'),
numPages: Math.ceil(xhr.response.items_available / itemsPerPage)
});
this.terminalRef.current.scrollTo(0, 0);
});
}
@@ -47,7 +49,7 @@ class WBLiveLogs extends Component {
<div>
<WBPagination activePage={ page } numPages={ numPages }
onPageChanged={ page => { this.state.page = page; this.fetchData(); } } />
<pre class="word-warp terminal">
<pre class="word-warp terminal" ref={ this.terminalRef }>
{ content }
</pre>
</div>


불러오는 중...
취소
저장