mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-09 21:14:06 +08:00
update files
This commit is contained in:
parent
1ce52405b6
commit
41c4e13669
@ -30,8 +30,20 @@ function clone(projects, index){
|
|||||||
return util.clone(projects[index] || EMPTYPROJECT);
|
return util.clone(projects[index] || EMPTYPROJECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
function scroll(element){
|
/**
|
||||||
element.scrollTop = element.scrollHeight;
|
* srcoll
|
||||||
|
* @param xterm
|
||||||
|
*/
|
||||||
|
function scroll(xterm){
|
||||||
|
var parent = xterm.element.parentNode;
|
||||||
|
|
||||||
|
if (parent) {
|
||||||
|
var viewHeight = xterm.element.parentNode.clientHeight;
|
||||||
|
|
||||||
|
if (viewHeight < xterm.y * 18) {
|
||||||
|
xterm.children[xterm.y].scrollIntoView();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Vue.component('app-main', {
|
module.exports = Vue.component('app-main', {
|
||||||
@ -76,9 +88,6 @@ module.exports = Vue.component('app-main', {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
isRunning: function (){
|
|
||||||
|
|
||||||
},
|
|
||||||
exec: function (name, command){
|
exec: function (name, command){
|
||||||
var xtermNode = this.$els.terminal;
|
var xtermNode = this.$els.terminal;
|
||||||
var runtime = window.AppRuntime[this.project.name];
|
var runtime = window.AppRuntime[this.project.name];
|
||||||
@ -126,7 +135,7 @@ module.exports = Vue.component('app-main', {
|
|||||||
xtermNode.appendChild(xterm.element);
|
xtermNode.appendChild(xterm.element);
|
||||||
|
|
||||||
xterm.write(test);
|
xterm.write(test);
|
||||||
scroll(xtermNode);
|
scroll(xterm);
|
||||||
|
|
||||||
window.xterm = xterm;
|
window.xterm = xterm;
|
||||||
|
|
||||||
@ -137,7 +146,7 @@ module.exports = Vue.component('app-main', {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
runtime.xterm.write(test);
|
runtime.xterm.write(test);
|
||||||
scroll(xtermNode);
|
scroll(runtime.xterm);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setting: function (){
|
setting: function (){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user