From 9ec72434496dce59bdac73a252433d197f74a687 Mon Sep 17 00:00:00 2001 From: Staz_The_Box Date: Mon, 4 Mar 2019 19:58:23 -0500 Subject: [PATCH] Fixed the loading symbol not appearing when refreshing the navigation. (#14783) Fixes #14763 Signed-off-by: Staz Drzyk --- js/navigation.js | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/js/navigation.js b/js/navigation.js index 29da6f0a96..0ba8e122ae 100644 --- a/js/navigation.js +++ b/js/navigation.js @@ -309,19 +309,20 @@ $(function () { */ $(document).on('click', '#pma_navigation_reload', function (event) { event.preventDefault(); - // reload icon object - var $icon = $(this).find('img'); - // source of the hidden throbber icon - var icon_throbber_src = $('#pma_navigation').find('.throbber').attr('src'); - // source of the reload icon - var icon_reload_src = $icon.attr('src'); - // replace the source of the reload icon with the one for throbber - $icon.attr('src', icon_throbber_src); - PMA_reloadNavigation(); - // after one second, put back the reload icon - setTimeout(function () { - $icon.attr('src', icon_reload_src); - }, 1000); + + // Find the loading symbol and show it + var $icon_throbber_src = $('#pma_navigation').find('.throbber'); + $icon_throbber_src.show(); + // TODO Why is a loading symbol both hidden, and invisible? + $icon_throbber_src.css('visibility', ''); + + // Callback to be used to hide the loading symbol when done reloading + function hideNav() { + $icon_throbber_src.hide(); + } + + // Reload the navigation + PMA_reloadNavigation(hideNav); }); $(document).on('change', '#navi_db_select', function (event) {