Allow "Add new..." button to redirect to webpages per category
parent
4133758bba
commit
31575212ad
|
@ -2,6 +2,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');
|
||||
|
||||
|
||||
function getGenderLetter(genderName) {
|
||||
|
@ -50,7 +51,7 @@ CATEGORIES.push(new Category(
|
|||
row.appendChild(spacerCell);
|
||||
},
|
||||
async function addSeason() {
|
||||
//
|
||||
window.location.href = "manage/addseason";
|
||||
},
|
||||
async function editSeason() {
|
||||
|
||||
|
@ -267,7 +268,7 @@ CATEGORIES.push(new Category(
|
|||
row.appendChild(dateCell);
|
||||
},
|
||||
async function addGame() {
|
||||
//
|
||||
window.location.href = "manage/addgame";
|
||||
},
|
||||
async function editSeason() {
|
||||
|
||||
|
@ -313,4 +314,5 @@ listItems(CATEGORIES[categoryDropdown.selectedIndex]);
|
|||
|
||||
categoryDropdown.onchange = () => {
|
||||
listItems(CATEGORIES[categoryDropdown.selectedIndex]);
|
||||
};
|
||||
};
|
||||
addNewButton.addEventListener('click', () => CATEGORIES[categoryDropdown.selectedIndex].addItem());
|
|
@ -20,7 +20,7 @@ block content
|
|||
div
|
||||
h2#table-header
|
||||
table#items-list
|
||||
button Add new...
|
||||
button#add-new-button Add new...
|
||||
|
||||
block scripts
|
||||
script(src='/scripts/manage.js' type="module")
|
Reference in New Issue