output clear

This commit is contained in:
Liang Ding 2015-01-14 14:52:39 +08:00
parent 4b9c9a871a
commit 15e0a79ebc
1 changed files with 5 additions and 4 deletions

View File

@ -408,10 +408,11 @@ var wide = {
switch (data.cmd) {
case 'run':
if (!wide.curProcessId) { // output first time
bottomGroup.fillOutput($('.bottom-window-group .output > div').html() + '<pre>' + data.output + '</pre>');
} else { // the following outputs
bottomGroup.fillOutput($('.bottom-window-group .output > div').html().replace(/<\/pre>$/g, data.output + '</pre>'));
var content = $('.bottom-window-group .output > div').html();
if (!wide.curProcessId || '' === content) {
bottomGroup.fillOutput(content + '<pre>' + data.output + '</pre>');
} else {
bottomGroup.fillOutput(content.replace(/<\/pre>$/g, data.output + '</pre>'));
}
wide.curProcessId = data.pid;