From e80b477525bb13d8bca3c98962f16a374fbe2e83 Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Mon, 8 Aug 2016 19:05:34 +0530 Subject: [PATCH] Scroll (using Animate) only when result div is visible We load the result div using data from AJAX request and make the div visible. So, we should scroll down when the div is visible and loaded with the appropriate data. Fix #12375 Signed-off-by: Deven Bansod --- js/db_search.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/db_search.js b/js/db_search.js index 945b081f27..2bde7cd9f2 100644 --- a/js/db_search.js +++ b/js/db_search.js @@ -48,16 +48,16 @@ function loadResult(result_path, table_name, link) $.get(url, {'ajax_request': true, 'is_js_confirmed': true}, function (data) { if (typeof data !== 'undefined' && data.success) { $('#browse-results').html(data.message); - $('html, body') - .animate({ - scrollTop: $("#browse-results").offset().top - }, 1000); PMA_ajaxRemoveMessage($msg); $('.table_results').each(function () { PMA_makegrid(this, true, true, true, true); }); $('#browse-results').show(); PMA_highlightSQL($('#browse-results')); + $('html, body') + .animate({ + scrollTop: $("#browse-results").offset().top + }, 1000); } else { PMA_ajaxShowMessage(data.error, false); }