mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge pull request #224 from sourcelair/Tyriar-patch-2
Sync scroll bar height if the viewport height changes
This commit is contained in:
@@ -375,14 +375,19 @@
|
||||
*/
|
||||
Viewport.prototype.syncScrollArea = function() {
|
||||
if (this.isApplicationMode) {
|
||||
// Fix scroll bar in application mode
|
||||
this.lastRecordedBufferLength = this.terminal.rows;
|
||||
this.refresh();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.lastRecordedBufferLength !== this.terminal.lines.length) {
|
||||
// If buffer height changed
|
||||
this.lastRecordedBufferLength = this.terminal.lines.length;
|
||||
this.refresh();
|
||||
} else if (this.lastRecordedViewportHeight !== this.terminal.rows) {
|
||||
// If viewport height changed
|
||||
this.refresh();
|
||||
} else {
|
||||
// If size has changed, refresh viewport
|
||||
var size = this.charMeasureElement.getBoundingClientRect();
|
||||
@@ -390,6 +395,8 @@
|
||||
this.refresh(size);
|
||||
}
|
||||
}
|
||||
|
||||
// Sync scrollTop
|
||||
var scrollTop = this.terminal.ydisp * this.currentRowHeight;
|
||||
if (this.viewportElement.scrollTop !== scrollTop) {
|
||||
this.viewportElement.scrollTop = scrollTop;
|
||||
|
||||
Reference in New Issue
Block a user