Этот коммит содержится в:
Asaad Mahmood
2015-10-14 17:04:13 +05:00
родитель cbefd88951
Коммит 99f243b444
15 изменённых файлов: 74 добавлений и 42 удалений

Просмотреть файл

@@ -9,7 +9,6 @@ export default class ErrorBar extends React.Component {
this.onErrorChange = this.onErrorChange.bind(this);
this.handleClose = this.handleClose.bind(this);
this.resize = this.resize.bind(this);
this.prevTimer = null;
this.state = ErrorStore.getLastError();
@@ -46,34 +45,14 @@ export default class ErrorBar extends React.Component {
return false;
}
resize() {
if (this.isValidError(this.state)) {
var height = $(React.findDOMNode(this)).outerHeight();
height = height < 30 ? 30 : height;
$('body').css('padding-top', height + 'px');
} else {
$('body').css('padding-top', '0');
}
}
componentDidMount() {
ErrorStore.addChangeListener(this.onErrorChange);
$(window).resize(() => {
this.resize();
});
this.resize();
}
componentWillUnmount() {
ErrorStore.removeChangeListener(this.onErrorChange);
}
componentDidUpdate() {
this.resize();
}
onErrorChange() {
var newState = ErrorStore.getLastError();