rebase kfet

This commit is contained in:
Ludovic Stephan 2016-11-17 16:51:36 -02:00
parent d559549c06
commit 9960e7e37e

View file

@ -34,12 +34,12 @@
<tr class="transfer_form" id="{{ form.prefix }}"> <tr class="transfer_form" id="{{ form.prefix }}">
<td class="from_acc_data"></td> <td class="from_acc_data"></td>
<td class="from_acc"> <td class="from_acc">
<input type="text" name="from_acc" class="input_from_acc" autocomplete="off" spellcheck="false"> <input type="text" name="from_acc" class="input_from_acc" maxlength="3" autocomplete="off" spellcheck="false">
{{ form.from_acc }} {{ form.from_acc }}
</td> </td>
<td class="amount">{{ form.amount }}</td> <td class="amount">{{ form.amount }}</td>
<td class="to_acc"> <td class="to_acc">
<input type="text" name="to_acc" class="input_to_acc" autocomplete="off" spellcheck="false"> <input type="text" name="to_acc" class="input_to_acc" maxlength="3" autocomplete="off" spellcheck="false">
{{ form.to_acc }} {{ form.to_acc }}
</td> </td>
<td class="to_acc_data"></td> <td class="to_acc_data"></td>
@ -71,18 +71,21 @@ $(document).ready(function () {
var $next = $form.next('.transfer_form').find('.from_acc input'); var $next = $form.next('.transfer_form').find('.from_acc input');
} }
var $input_id = $input.next('input'); var $input_id = $input.next('input');
getAccountData(trigramme, function(data) { if (isValidTrigramme(trigramme)) {
$input_id.val(data.id); getAccountData(trigramme, function(data) {
$data.text(data.name); $input_id.val(data.id);
$next.focus(); $data.text(data.name);
}); $next.focus();
});
} else {
$input_id.val('');
$data.text('');
}
} }
$('.input_from_acc, .input_to_acc').on('input', function() { $('.input_from_acc, .input_to_acc').on('input', function() {
var tri = $(this).val().toUpperCase(); var tri = $(this).val().toUpperCase();
if (isValidTrigramme(tri)) { updateAccountData(tri, $(this));
updateAccountData(tri, $(this));
}
}); });
$('#transfers_form').on('submit', function(e) { $('#transfers_form').on('submit', function(e) {