listy, i inne funkcje
This commit is contained in:
26
static/js/transakcje.js
Normal file
26
static/js/transakcje.js
Normal file
@@ -0,0 +1,26 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const modalW = new bootstrap.Modal(document.getElementById('modalWplata'));
|
||||
const modalX = new bootstrap.Modal(document.getElementById('modalWydatek'));
|
||||
|
||||
// WPŁATA
|
||||
document.querySelectorAll('.btn-edit-wplata').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
const form = document.getElementById('formWplata');
|
||||
form.action = btn.dataset.action;
|
||||
document.getElementById('wplataKwota').value = btn.dataset.kwota || '';
|
||||
document.getElementById('wplataOpis').value = btn.dataset.opis || '';
|
||||
modalW.show();
|
||||
});
|
||||
});
|
||||
|
||||
// WYDATEK
|
||||
document.querySelectorAll('.btn-edit-wydatek').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
const form = document.getElementById('formWydatek');
|
||||
form.action = btn.dataset.action;
|
||||
document.getElementById('wydatekKwota').value = btn.dataset.kwota || '';
|
||||
document.getElementById('wydatekOpis').value = btn.dataset.opis || '';
|
||||
modalX.show();
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user