提交 ad5c5295 编写于 作者: J Joao Moreno

call InputBox.layout from the outside

fixes #210
上级 7b17eca6
......@@ -131,7 +131,7 @@ export class InputBox extends ee.EventEmitter {
}
}
setTimeout(() =>this.adjustHeight(), 0);
setTimeout(() =>this.layout(), 0);
// Support actions
if (this.options.actions) {
......@@ -324,19 +324,22 @@ export class InputBox extends ee.EventEmitter {
var lastCharCode = this.value.charCodeAt(this.value.length - 1);
var suffix = lastCharCode === 10 ? ' ' : '';
this.mirror.textContent = this.value + suffix;
this.adjustHeight();
this.layout();
}
}
private adjustHeight(): void {
public layout(): void {
if (!this.mirror) {
return;
}
const previousHeight = this.cachedHeight;
this.cachedHeight = dom.getTotalHeight(this.mirror);
this.input.style.height = this.cachedHeight + 'px';
this.emit('heightchange', this.cachedHeight);
if (previousHeight !== this.cachedHeight) {
this.input.style.height = this.cachedHeight + 'px';
this.emit('heightchange', this.cachedHeight);
}
}
public dispose(): void {
......
......@@ -197,6 +197,7 @@ export class ChangesView extends EventEmitter.EventEmitter implements GitView.IV
this.currentDimension = dimension;
this.commitInputBox.layout();
var statusViewHeight = dimension.height - (this.commitInputBox.height + 10 /* margin */);
this.$statusView.size(dimension.width, statusViewHeight);
this.tree.layout(statusViewHeight);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册