From 48c5373668c8659f05daad1f96287684f0bb574a Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 3 Sep 2015 12:07:41 +0200 Subject: Fix scrolling and line-breaking in CodeQ console --- js/codeq/console.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'js/codeq/console.js') diff --git a/js/codeq/console.js b/js/codeq/console.js index 023fcc1..ddf4ce6 100644 --- a/js/codeq/console.js +++ b/js/codeq/console.js @@ -550,7 +550,7 @@ handleInput = function (chars) { var cookedChars = chars, // default startingRow = currentRow, - endingRow, i; + dh, i; if (inputDisabled) { // flatly ignore @@ -580,7 +580,7 @@ if (lineBuffered) { if (currentRow !== startingRow) { // in line-buffered mode emit each line separately, except for the last (current) line - for (i = startingRow; i < endingRow; i++) { + for (i = startingRow; i < lines.length; i++) { try { handler.onInput(lines[i].content); } @@ -601,6 +601,11 @@ } clipboardPasteInProgress = false; + + // scroll to bottom on input + dh = jqContent.height() - jqElt.height(); + if (dh > 0) + jqElt.scrollTop(dh); }, clipboardPasteInProgress = false, // whether the previous keydown was a CTRL+V or shift+insert @@ -713,4 +718,4 @@ return handler; }; -})(); \ No newline at end of file +})(); -- cgit v1.2.1