Code formatting
This commit is contained in:
parent
8476738925
commit
de554bfa0b
|
@ -19,7 +19,7 @@ class MapPageComponent extends AuthComponent {
|
||||||
showKillDialog: false,
|
showKillDialog: false,
|
||||||
telemetry: [],
|
telemetry: [],
|
||||||
telemetryLastTimestamp: null,
|
telemetryLastTimestamp: null,
|
||||||
movedTop: false,
|
isScrolledUp: false,
|
||||||
};
|
};
|
||||||
this.telemConsole = React.createRef();
|
this.telemConsole = React.createRef();
|
||||||
this.handleScroll = this.handleScroll.bind(this);
|
this.handleScroll = this.handleScroll.bind(this);
|
||||||
|
@ -73,7 +73,7 @@ class MapPageComponent extends AuthComponent {
|
||||||
this.props.onStatusChange();
|
this.props.onStatusChange();
|
||||||
|
|
||||||
let telemConsoleRef = this.telemConsole.current;
|
let telemConsoleRef = this.telemConsole.current;
|
||||||
if(!this.state.movedTop){
|
if (!this.state.isScrolledUp) {
|
||||||
telemConsoleRef.scrollTop = telemConsoleRef.scrollHeight - telemConsoleRef.clientHeight;
|
telemConsoleRef.scrollTop = telemConsoleRef.scrollHeight - telemConsoleRef.clientHeight;
|
||||||
this.scrollTop = telemConsoleRef.scrollTop;
|
this.scrollTop = telemConsoleRef.scrollTop;
|
||||||
}
|
}
|
||||||
|
@ -148,15 +148,13 @@ class MapPageComponent extends AuthComponent {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleScroll(e){
|
handleScroll(e) {
|
||||||
|
|
||||||
let element = e.target;
|
let element = e.target;
|
||||||
if(element.scrollTop < this.scrollTop){
|
if (element.scrollTop < this.scrollTop) {
|
||||||
this.setState({movedTop: true});
|
this.setState({isScrolledUp: true});
|
||||||
}else{
|
} else {
|
||||||
this.setState({movedTop: false});
|
this.setState({isScrolledUp: false});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
renderTelemetryConsole() {
|
renderTelemetryConsole() {
|
||||||
|
|
Loading…
Reference in New Issue