Commit a7ff98cd authored by Leo Iannacone's avatar Leo Iannacone

fixed scroll down

parent 6e7364b1
...@@ -145,11 +145,17 @@ function Page_Distrubion(socket) ...@@ -145,11 +145,17 @@ function Page_Distrubion(socket)
$('#file').hide() $('#file').hide()
}, },
append: function(data) { append: function(data) {
var new_html = $("#file pre").html() + data.file.new_content var content = $("#file pre")
$("#file pre").html(new_html) content.html(content.html() + data.file.new_content)
if (config.autoscroll) // scroll down if (config.autoscroll) {
$('body,html').animate({ scrollTop: $('#file pre').height() }, 500); // 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() { get: function() {
if (Utils.check_data_file(data)) { if (Utils.check_data_file(data)) {
......
...@@ -24,9 +24,8 @@ ...@@ -24,9 +24,8 @@
<h4>Debs</h4> <h4>Debs</h4>
<ul></ul> <ul></ul>
</nav> </nav>
</section> </section>
</div> </div>
</aside> </aside>
<section class="col-md-9"> <section class="col-md-9">
...@@ -35,6 +34,7 @@ ...@@ -35,6 +34,7 @@
</header> </header>
<div id="file"> <div id="file">
<pre></pre> <pre></pre>
<div id="fileOffset"></div>
</div> </div>
</section> </section>
</article> </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