diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index e3bf8432..b27c59c3 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -523,8 +523,6 @@ if ((is_safe_for_install_color === "warning") || (is_safe_for_install_color === "danger")) { - // Disable the pacman while we ask for confirmation - $('div.loader').remove(); c.confirm( y18n.t("applications"), y18n.t("confirm_install_app_"+is_safe_for_install_color), diff --git a/src/js/yunohost/controllers/home.js b/src/js/yunohost/controllers/home.js index 54e201d6..d3361df6 100644 --- a/src/js/yunohost/controllers/home.js +++ b/src/js/yunohost/controllers/home.js @@ -24,20 +24,17 @@ $('#masthead').show() .find('.logout-btn').hide(); store.set('path-1', '#/login'); - if ($('div.loader').length === 0) { - $('#main').append('
'); - } + + c.showLoader(); c.checkInstall(function(isInstalled) { if (isInstalled) { - // Remove loader - $('div.loader').remove(); + c.hideLoader(); // Pass domain to hide form field c.view('login', { 'domain': window.location.hostname }); } else if (typeof isInstalled === 'undefined') { if (app.isInstalledTry > 0) { app.isInstalledTry--; - app.loaded = false; // Show pacman setTimeout(function() { c.redirect('#/'); }, 5000); @@ -56,12 +53,10 @@ $(document).off('ajaxError'); }); - // Remove pacman - app.loaded = true; - $('div.loader').remove(); + c.hideLoader(); } } else { - $('div.loader').remove(); + c.hideLoader(); c.redirect('#/postinstall'); } }); diff --git a/src/js/yunohost/controllers/tools.js b/src/js/yunohost/controllers/tools.js index 52c69133..4e62c693 100644 --- a/src/js/yunohost/controllers/tools.js +++ b/src/js/yunohost/controllers/tools.js @@ -146,7 +146,7 @@ $('button[data-action="share"]').on("click", function() { c.api('GET', '/logs/display?path='+$(this).data('log-id')+'&share', {}, function(data) { - $('div.loader').remove(); + c.hideLoader(); window.open(data.url, '_blank'); }); }); @@ -241,8 +241,7 @@ $('#main').replaceWith('