Skip to content

Commit

Permalink
Rework scrolling a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
gashcrumb committed Oct 24, 2013
1 parent 969122e commit e980632
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions hawtio-web/src/main/webapp/index.html
Expand Up @@ -314,29 +314,33 @@ <h2 title="Status Code: {{connectFailure.status}}">Cannot Connect: {{connectFail

node.innerHTML = text;
node.className = context.level.name;
Rainbow.color(node, function() {
panel.appendChild(node);
});
//panel.appendChild(node);
if (panel.childNodes.length > parseInt(window['LogBuffer'])) {
panel.firstChild.remove();
}

var scroll = false;
if (container.scrollHeight = 0) {
panel.scrollTop = panel.scrollHeight;
scroll = true;
}

if (panel.scrollTop > (panel.scrollHeight - container.scrollHeight - 200)) {
panel.scrollTop = panel.scrollHeight;
scroll = true;
}
if (consoleLogger) {
consoleLogger(messages, context);
}
var interceptors = window['logInterceptors'];

for (var i = 0; i < interceptors.length; i++) {
interceptors[i](context.level.name, text);
}
Rainbow.color(node, function() {
panel.appendChild(node);
if (scroll) {
panel.scrollTop = panel.scrollHeight;
}
if (panel.childNodes.length > parseInt(window['LogBuffer'])) {
panel.firstChild.remove();
}
if (consoleLogger) {
consoleLogger(messages, context);
}
var interceptors = window['logInterceptors'];

for (var i = 0; i < interceptors.length; i++) {
interceptors[i](context.level.name, text);
}
});

});

Expand Down

0 comments on commit e980632

Please sign in to comment.