From e6579a9fbe26783bd805b7ce88a651bbbc04fae2 Mon Sep 17 00:00:00 2001 From: NightHawk32 Date: Wed, 25 Nov 2015 16:51:50 -0500 Subject: [PATCH] Added callback for log close animation, on close the log now scrolls to the most recent log entry. --- main.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.js b/main.js index 14934f3b..2bd3ea24 100644 --- a/main.js +++ b/main.js @@ -315,13 +315,16 @@ $(document).ready(function () { $("#showlog").on('click', function() { var state = $(this).data('state'); if ( state ) { - $("#log").animate({height: 27}, 200); + $("#log").animate({height: 27}, 200, function() { + var command_log = $('div#log'); + command_log.scrollTop($('div.wrapper', command_log).height()); + }); $("#log").removeClass('active'); $("#content").removeClass('logopen'); $(".tab_container").removeClass('logopen'); $("#scrollicon").removeClass('active'); - chrome.storage.local.set({'logopen': false}); - + chrome.storage.local.set({'logopen': false}); + state = false; }else{ $("#log").animate({height: 111}, 200); @@ -329,7 +332,7 @@ $(document).ready(function () { $("#content").addClass('logopen'); $(".tab_container").addClass('logopen'); $("#scrollicon").addClass('active'); - chrome.storage.local.set({'logopen': true}); + chrome.storage.local.set({'logopen': true}); state = true; }