Added AFLOW-46 (duplicating items)
This commit is contained in:
parent
f52897fd4d
commit
40be3ef91d
@ -1,12 +0,0 @@
|
|||||||
function randomInRange(min, max) {
|
|
||||||
return Math.random() * (max - min) + min;
|
|
||||||
}
|
|
||||||
|
|
||||||
function doTheConfetti() {
|
|
||||||
confetti({
|
|
||||||
angle: randomInRange(90, 110),
|
|
||||||
spread: randomInRange(70, 120),
|
|
||||||
particleCount: randomInRange(100, 200),
|
|
||||||
origin: { y: 0.6, x: randomInRange(0.4, 0.8) },
|
|
||||||
});
|
|
||||||
}
|
|
@ -8,6 +8,16 @@ function primeCreateNew() {
|
|||||||
return true;
|
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() {
|
function primeEdit() {
|
||||||
const form = document.getElementById('ItemModalForm');
|
const form = document.getElementById('ItemModalForm');
|
||||||
document.getElementById('itemModifyModalLabel').innerText = 'Edit an item';
|
document.getElementById('itemModifyModalLabel').innerText = 'Edit an item';
|
||||||
|
@ -49,6 +49,9 @@ function dataResponseHandler(json) {
|
|||||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#itemModifyModal" onclick="primeEdit(); getDataForEdit('${item.id}')">
|
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#itemModifyModal" onclick="primeEdit(); getDataForEdit('${item.id}')">
|
||||||
<i class="bi bi-pencil"></i>
|
<i class="bi bi-pencil"></i>
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#itemModifyModal" onclick="triggerDuplicationDialog('${item.id}')">
|
||||||
|
<i class="bi bi-copy"></i>
|
||||||
|
</button>
|
||||||
<button class="btn btn-danger" onclick="preFillDeleteModalNxt('${item.id}','items','Item')" data-bs-toggle="modal" data-bs-target="#staticBackdrop">
|
<button class="btn btn-danger" onclick="preFillDeleteModalNxt('${item.id}','items','Item')" data-bs-toggle="modal" data-bs-target="#staticBackdrop">
|
||||||
<i class="bi bi-trash"></i>
|
<i class="bi bi-trash"></i>
|
||||||
</button>`
|
</button>`
|
||||||
|
Loading…
Reference in New Issue
Block a user