Various code related to the recurring transactions.

This commit is contained in:
James Cole
2018-06-12 18:48:15 +02:00
parent 2de19547ca
commit 4b4dc2e298
9 changed files with 213 additions and 115 deletions

View File

@@ -32,12 +32,44 @@ $(document).ready(function () {
initializeButtons();
initializeAutoComplete();
respondToFirstDateChange();
respondToRepetitionEnd();
$('.switch-button').on('click', switchTransactionType);
$('#ffInput_repetition_end').on('change', respondToRepetitionEnd);
$('#ffInput_first_date').on('change', respondToFirstDateChange);
$('#calendar-link').on('click', showRepCalendar);
});
function showRepCalendar() {
// fill model with calendar:
$('#defaultModal').modal({});
return false;
}
function respondToRepetitionEnd() {
var obj = $('#ffInput_repetition_end');
var value = obj.val();
switch (value) {
case 'forever':
$('#repeat_until_holder').hide();
$('#repetitions_holder').hide();
break;
case 'until_date':
$('#repeat_until_holder').show();
$('#repetitions_holder').hide();
break;
case 'times':
$('#repeat_until_holder').hide();
$('#repetitions_holder').show();
break;
}
}
function respondToFirstDateChange() {
var obj = $('#ffInput_first_date');
var select = $('#ffInput_repetition_type');