diff --git a/public/scripts/manage.js b/public/scripts/manage.js index a77a7d6..04ebb1c 100644 --- a/public/scripts/manage.js +++ b/public/scripts/manage.js @@ -3,6 +3,7 @@ import * as Data from "./data.js"; const categoryDropdown = document.getElementById('category-dropdown'); const itemsListTable = document.getElementById('items-list'); const addNewButton = document.getElementById('add-new-button'); +const loadingSpan = document.getElementById('loading-message'); function getGenderLetter(genderName) { @@ -362,6 +363,8 @@ CATEGORIES.push(new Category( async function listItems(category) { + loadingSpan.textContent = "Loading..."; + itemsListTable.innerHTML = ""; const itemsList = await category.getItems(); @@ -389,6 +392,8 @@ async function listItems(category) { itemsListTable.appendChild(row); }); + + loadingSpan.textContent = ''; } if(window.location.hash) { let correctIndex; diff --git a/views/manage.pug b/views/manage.pug index 63d76ec..bd8a228 100644 --- a/views/manage.pug +++ b/views/manage.pug @@ -18,6 +18,7 @@ block content option(value="accounts") Accounts div h2#table-header + span#loading-message Loading... table#items-list button#add-new-button Add new...