From 7983a7b038e6e7cbb8e483e5c2262e2b78c78d42 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Thu, 20 Sep 2018 15:20:58 +0200 Subject: [PATCH] Use loadingBar utility. --- src/templates/layout.pug | 2 +- src/templates/projects/view.pug | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/templates/layout.pug b/src/templates/layout.pug index 3daffce..bc5289b 100644 --- a/src/templates/layout.pug +++ b/src/templates/layout.pug @@ -122,7 +122,7 @@ html(lang="en") title="Sign up") Sign up | {% endif %} - .loader-bar + .loading-bar .page-content #search-overlay diff --git a/src/templates/projects/view.pug b/src/templates/projects/view.pug index 346cdf8..551c1f7 100644 --- a/src/templates/projects/view.pug +++ b/src/templates/projects/view.pug @@ -349,7 +349,7 @@ script. // TODO: Maybe remove this, now it's also in loadNodeContent(), but double-check // it's done like that in all users of updateUi(). - $('.loader-bar').removeClass('active'); + loadingBarHide(); } | {% endblock %} @@ -377,7 +377,9 @@ script. function loadNodeContent(url, nodeId) { - $('.loader-bar').addClass('active'); + + loadingBarShow(); + $.get(url, function(dataHtml) { // Update the DOM injecting the generate HTML into the page $('#project_context').html(dataHtml); @@ -390,14 +392,14 @@ script. $('#server_error').attr('src', url); }) .always(function(){ - $('.loader-bar').removeClass('active'); + loadingBarHide(); $('.button-edit-icon').addClass('pi-edit').removeClass('pi-spin spin'); }); } function loadProjectContent(url) { - $('.loader-bar').addClass('active'); + loadingBarShow(); $.get(url, function(dataHtml) { // Update the DOM injecting the generated HTML into the page @@ -413,7 +415,7 @@ script. $('#server_error').attr('src', url); }) .always(function(){ - $('.loader-bar').removeClass('active'); + loadingBarHide(); $('.button-edit-icon').addClass('pi-edit').removeClass('pi-spin spin'); }); }