blob: fa3d22826cd027a63be5d2d8b1ddb68d2da7f106 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
var resultOutputDiv = document.getElementById("result_output");
var resultControlsDiv = document.getElementById("activity_controls");
var outputHTML = "<%= j render(partial: "application/results", locals: { results: @results }) %>"
if (resultOutputDiv) {
resultOutputDiv.innerHTML += outputHTML;
// If scrolled to the bottom or near the bottom, then smooth scroll to the bottom.
if ((resultOutputDiv.scrollTop + 100) >= (resultOutputDiv.scrollHeight - resultOutputDiv.offsetHeight)) {
resultOutputDiv.scrollTo({
top: resultOutputDiv.scrollHeight, left: 0, behavior: 'smooth'
});
}
}
if (resultControlsDiv) {
resultControlsDiv.innerHTML = "<%= j render(partial: "application/timer") %>"
}
|