mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-07 11:34:05 +08:00
update files
This commit is contained in:
parent
39dfb29524
commit
0f6cc6bd35
@ -38,10 +38,12 @@ function scroll(xterm){
|
|||||||
var parent = xterm.element.parentNode;
|
var parent = xterm.element.parentNode;
|
||||||
|
|
||||||
if (parent) {
|
if (parent) {
|
||||||
var viewHeight = xterm.element.parentNode.clientHeight;
|
var height = (xterm.y + 2) * 18;
|
||||||
|
var scrollTop = parent.scrollTop;
|
||||||
|
var viewHeight = parent.clientHeight;
|
||||||
|
|
||||||
if (viewHeight < xterm.y * 18) {
|
if (scrollTop > height || height > scrollTop + viewHeight) {
|
||||||
xterm.children[xterm.y].scrollIntoView();
|
parent.scrollTop = Math.max(0, height - viewHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -62,7 +64,7 @@ function createXTerm(name, xtermNode){
|
|||||||
|
|
||||||
xterm.focus();
|
xterm.focus();
|
||||||
xtermNode.appendChild(xterm.element);
|
xtermNode.appendChild(xterm.element);
|
||||||
xterm.children[xterm.y].scrollIntoView();
|
scroll(xterm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user