From 29d3ca9190862dfa3d2520dcfa734eca2d8f5e7d Mon Sep 17 00:00:00 2001 From: Andy Janata Date: Sat, 24 Dec 2011 19:38:19 -0800 Subject: [PATCH] only scroll the log window if it was already scrolled to the bottom --- WebContent/js/cah.log.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WebContent/js/cah.log.js b/WebContent/js/cah.log.js index 327302e..d9ccf04 100644 --- a/WebContent/js/cah.log.js +++ b/WebContent/js/cah.log.js @@ -7,8 +7,11 @@ cah.log = {}; cah.log.status = function(text) { + var scroll = $("#log").prop("scrollHeight") - $("#log").height() - $("#log").prop("scrollTop") <= 5; $("#log").append("[" + new Date().toLocaleTimeString() + "] " + text + "
"); - $("#log").prop("scrollTop", $("#log").prop("scrollHeight")); + if (scroll) { + $("#log").prop("scrollTop", $("#log").prop("scrollHeight")); + } }; cah.log.error = function(text) {