forked from p15670423/monkey
Refactor code
This commit is contained in:
parent
d806746aea
commit
0a7da90150
|
@ -156,17 +156,18 @@ class MapPageComponent extends AuthComponent {
|
||||||
let telemetryStyle = window.getComputedStyle(element)
|
let telemetryStyle = window.getComputedStyle(element)
|
||||||
let telemetryLineHeight = parseInt((telemetryStyle.lineHeight).replace('px', ''))
|
let telemetryLineHeight = parseInt((telemetryStyle.lineHeight).replace('px', ''))
|
||||||
|
|
||||||
|
this.setState({
|
||||||
|
telemetryCurrentLine: parseInt(element.scrollTop/telemetryLineHeight)+1,
|
||||||
|
telemetryLines: parseInt(element.scrollHeight/telemetryLineHeight),
|
||||||
|
});
|
||||||
|
|
||||||
if (element.scrollTop < this.scrollTop) {
|
if (element.scrollTop < this.scrollTop) {
|
||||||
this.setState({
|
this.setState({
|
||||||
isScrolledUp: true,
|
isScrolledUp: true,
|
||||||
telemetryCurrentLine: parseInt(element.scrollTop/telemetryLineHeight)+1,
|
|
||||||
telemetryLines: parseInt(element.scrollHeight/telemetryLineHeight),
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
isScrolledUp: false,
|
isScrolledUp: false,
|
||||||
telemetryCurrentLine: parseInt(element.scrollTop/telemetryLineHeight)+1,
|
|
||||||
telemetryLines: parseInt(element.scrollHeight/telemetryLineHeight),
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue