Fixed the loading symbol not appearing when refreshing the navigation. (#14783)

Fixes #14763

Signed-off-by: Staz Drzyk <staz@staz.io>
(cherry picked from commit 9ec7243449)
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Staz_The_Box 2019-03-04 19:58:23 -05:00 committed by Maurício Meneghini Fauth
parent 102d7738c8
commit 2498813289

View File

@ -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) {