Archived
0

MCSM:Webconsole: исправлено пара ошибок

- полоска прокрутки показывается только при необходимости;
- при переключении серверов, консоль очищается.
This commit is contained in:
2017-06-11 23:32:15 +03:00
parent aaceb30bd2
commit e1716e674a
2 changed files with 7 additions and 3 deletions

View File

@@ -82,8 +82,11 @@ var ScrollingContent = React.createClass({
this.scrollRatio = this.ownHeight / this.totalHeight;
if (isNaN(this.scrollRatio)) this.scrollRatio = 0;
this.refs.scroll.style.height = this.scrollRatio * 100 + "%";
this.refs.scroll.style.top = (this.refs.content.scrollTop / this.totalHeight) * 100 + "%";
var h = this.scrollRatio * 100;
if (h < 100) {
this.refs.scroll.style.height = h + "%";
this.refs.scroll.style.top = (this.refs.content.scrollTop / this.totalHeight) * 100 + "%";
}
},
toggleSelect: function (value, event) { return value; },
handleScrollMouseDown: function (event) {
@@ -231,6 +234,7 @@ var ServerInfo = React.createClass({
if (this.state.title === null) return;
if (this.state.title !== nextState.title) {
this.refs.webconsole.disconnect();
this.refs.webconsole.setState({lines: []});
this.refs.tabs.setState({activeTab: 0});
}
}