Skip to content

Commit d165522

Browse files
authored
Merge pull request #28 from spadgett/resize-multiple-terminals
Resize correct terminal when more than one is on the page
2 parents 7933d51 + e1e873b commit d165522

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

container-terminal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
if (!term.charMeasure.width) {
130130
return;
131131
}
132-
var xtermViewport = document.getElementsByClassName("xterm-viewport")[0];
132+
var xtermViewport = element[0].getElementsByClassName("xterm-viewport")[0];
133133
// character width * number of columns + space for a scrollbar
134134
// TODO determine the max width of a scrollbar across browsers
135135
xtermViewport.style.width = (term.charMeasure.width * cols + 17) + "px";

dist/container-terminal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
if (!term.charMeasure.width) {
130130
return;
131131
}
132-
var xtermViewport = document.getElementsByClassName("xterm-viewport")[0];
132+
var xtermViewport = element[0].getElementsByClassName("xterm-viewport")[0];
133133
// character width * number of columns + space for a scrollbar
134134
// TODO determine the max width of a scrollbar across browsers
135135
xtermViewport.style.width = (term.charMeasure.width * cols + 17) + "px";

0 commit comments

Comments
 (0)