Add a checkbox to auto-scroll logs on job view

This commit is contained in:
Alexandre Aubin 2021-03-01 22:38:57 +01:00
parent d92a9351fb
commit 1fd5a437ab

View file

@ -26,6 +26,10 @@
<h2 class="subtitle">Execution log:</h2>
<pre class="consoleOutput" v-html="logWithColors"></pre>
<div style="float:right">
<input type="checkbox" id="auto_scroll" name="auto_scroll" value="">
<label for="auto_scroll"> Auto-scroll</label>
</div>
</div>
</section>
<% endblock %>
@ -77,6 +81,12 @@
Vue.set(app.job, "deleted", true);
Vue.set(app.job, "state", "deleted");
}
if ($("#auto_scroll")[0].checked === true)
{
var elem = $(".consoleOutput")[0];
elem.scrollTop = elem.scrollHeight;
}
};
})()
</script>