diff --git a/static/js/confettiHeader.js b/static/js/confettiHeader.js index 091f065..68a27c1 100644 --- a/static/js/confettiHeader.js +++ b/static/js/confettiHeader.js @@ -3,6 +3,7 @@ function randomInRange(min, max) { } function doTheConfetti() { + // Create confetti confetti({ angle: randomInRange(90, 110), spread: randomInRange(70, 120), diff --git a/static/js/editItems.js b/static/js/editItems.js index 61d1e6d..a96141b 100644 --- a/static/js/editItems.js +++ b/static/js/editItems.js @@ -8,6 +8,16 @@ function primeCreateNew() { return true; } +function triggerDuplicationDialog(sourceItemId) { + // Clear the form + $('.form-control').val(''); + const form = document.getElementById('ItemModalForm'); + document.getElementById('itemModifyModalLabel').innerText= "Duplicate an item"; + form.setAttribute('method', 'POST'); + getDataForEdit(sourceItemId); + return true; +} + function primeEdit() { const form = document.getElementById('ItemModalForm'); document.getElementById('itemModifyModalLabel').innerText = 'Edit an item'; diff --git a/static/js/itemPageHandler.js b/static/js/itemPageHandler.js index 7b9d3c6..90fe789 100644 --- a/static/js/itemPageHandler.js +++ b/static/js/itemPageHandler.js @@ -49,6 +49,9 @@ function dataResponseHandler(json) { + `