From 42e4d54da2a2e3d22aee5da6f5cb8b032d77858d Mon Sep 17 00:00:00 2001 From: nuintun Date: Thu, 14 Jan 2016 15:55:41 +0800 Subject: [PATCH] update files --- static/js/components/app-main/index.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/static/js/components/app-main/index.js b/static/js/components/app-main/index.js index 164aa61..186b36a 100644 --- a/static/js/components/app-main/index.js +++ b/static/js/components/app-main/index.js @@ -34,15 +34,15 @@ function clone(projects, index){ /** * srcoll * @param xterm - * @param parent + * @param y */ -function scroll(xterm, parent){ - var height = (xterm.y + 2) * 18; - var scrollTop = parent.scrollTop; - var viewHeight = parent.clientHeight; +function scroll(xterm, y){ + var height = (y + 2) * 18; + var scrollTop = xterm.scrollTop; + var viewHeight = xterm.clientHeight; if (scrollTop > height || height > scrollTop + viewHeight) { - parent.scrollTop = Math.max(0, height - viewHeight); + xterm.scrollTop = Math.max(0, height - viewHeight); } } @@ -70,7 +70,6 @@ function openXTerm(vm){ } else if (event.data.screen && !document.hidden) { vm.$els.terminal.innerHTML = event.data.screen; } - } });