list create / add item, no interactivity yet
This commit is contained in:
11
web/app.html
11
web/app.html
@ -18,9 +18,20 @@
|
||||
<input id="additemid" type="text" placeholder="item id" pattern="[0-9]*">
|
||||
<input id="addattributes" type="text" placeholder="attributes (comma separated)" pattern="[0-9a-zA-Z, ]*">
|
||||
<button id="addbutton" type="button">Add</button>
|
||||
<button id="create_list" type="button">create list</button>
|
||||
<button id="global_toggleshow" class="global_toggleshow" type="button">show hidden</button>
|
||||
</div>
|
||||
|
||||
<!--popup create new list-->
|
||||
<div id="createListPopup" class="popup">
|
||||
<div class="popup-content">
|
||||
<p>Create new list</p>
|
||||
<input id="listName" type="text" placeholder="name">
|
||||
<input id="listDescription" type="text" placeholder="description">
|
||||
<button id="create_list_cancel" type="button">cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--popup confirmation window-->
|
||||
<div id="confirmationPopup" class="popup">
|
||||
<div class="popup-content">
|
||||
|
17
web/app.js
17
web/app.js
@ -142,6 +142,23 @@ const apiUrl = `${currentUrl}app/delete`;
|
||||
}
|
||||
}
|
||||
|
||||
// close popups with escape key
|
||||
document.addEventListener("keydown", (event) => {
|
||||
if (event.isComposing || event.key === 'Escape') {
|
||||
Array.from(document.getElementsByClassName("popup")).forEach(function(x) {
|
||||
x.style.display = 'none';
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// create new list
|
||||
document.getElementById("create_list").addEventListener("click", function () {
|
||||
createListPopup.style.display = 'flex';
|
||||
});
|
||||
document.getElementById("create_list_cancel").addEventListener("click", function () {
|
||||
createListPopup.style.display = 'none';
|
||||
});
|
||||
|
||||
|
||||
// delete item, pop-up confirm
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
Reference in New Issue
Block a user