Commit a7ff98cd authored by Leo Iannacone's avatar Leo Iannacone

fixed scroll down

parent 6e7364b1
......@@ -145,11 +145,17 @@ function Page_Distrubion(socket)
$('#file').hide()
},
append: function(data) {
var new_html = $("#file pre").html() + data.file.new_content
$("#file pre").html(new_html)
var content = $("#file pre")
content.html(content.html() + data.file.new_content)
if (config.autoscroll) // scroll down
$('body,html').animate({ scrollTop: $('#file pre').height() }, 500);
if (config.autoscroll) {
// scroll down if file is covering footer
var file_height = $("#fileOffset").offset().top
var footerOffset = $("footer").offset().top
if (file_height > footerOffset) {
$('html').animate({ scrollTop: file_height }, 0);
}
}
},
get: function() {
if (Utils.check_data_file(data)) {
......
......@@ -26,7 +26,6 @@
</nav>
</section>
</div>
</aside>
<section class="col-md-9">
......@@ -35,6 +34,7 @@
</header>
<div id="file">
<pre></pre>
<div id="fileOffset"></div>
</div>
</section>
</article>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment