Option sur les reset K-Psul pour donner le focus ou non à input

trigramme
This commit is contained in:
Aurélien Delobelle 2016-08-17 11:51:44 +02:00
parent a5e571de97
commit a9cec3a920
2 changed files with 5 additions and 8 deletions

View file

@ -769,7 +769,7 @@ $(document).ready(function() {
// Reset functions
function coolReset() {
function coolReset(give_tri_focus=true) {
resetAccountData();
articleId.val(0);
articleSelect.val('');
@ -777,16 +777,17 @@ $(document).ready(function() {
displayMatchedArticles(articlesList);
triInput.val('');
resetBasket();
if (give_tri_focus)
triInput.focus();
}
function hardReset() {
coolReset();
function hardReset(give_tri_focus=true) {
coolReset(give_tri_focus);
articles_container.find('tr').remove();
articlesList = [];
resetCheckoutData();
getArticlesData();
getHistory();
}
// Shorcuts
@ -796,7 +797,6 @@ $(document).ready(function() {
case 112:
// F1 - Cool reset
coolReset();
triInput.focus();
return false;
case 113:
// F2 - Deposit
@ -809,7 +809,6 @@ $(document).ready(function() {
case 121:
// F10 - Hard reset
hardReset();
triInput.focus();
return false;
}
});
@ -819,7 +818,6 @@ $(document).ready(function() {
// -----
hardReset();
triInput.focus();
});
</script>

View file

@ -408,7 +408,6 @@ def kpsul(request):
data['checkout_form'] = KPsulCheckoutForm()
operation_formset = KPsulOperationFormSet(queryset=Operation.objects.none())
data['operation_formset'] = operation_formset
print(operation_formset.empty_form)
return render(request, 'kfet/kpsul.html', data)
@permission_required('kfet.is_team')