Add loading message to manage page
parent
7ec36ed7f2
commit
42ac77ec6f
|
@ -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;
|
||||
|
|
|
@ -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...
|
||||
|
||||
|
|
Reference in New Issue