Remove the "add vs. subtract" mode for desktop inventory workflow form

hopefully we can always assume the "mode" based on other things
This commit is contained in:
Lance Edgar 2018-03-06 16:26:53 -06:00
parent 802f4bfd6b
commit 6ec0ddb94e
2 changed files with 9 additions and 39 deletions

View file

@ -130,25 +130,11 @@
return false;
});
$('#add').click(function() {
if (! assert_quantity()) {
return;
}
$(this).button('disable').button('option', 'label', "Working...");
$('#mode').val('add');
$('#inventory-form').submit();
});
$('#subtract').click(function() {
if (! assert_quantity()) {
return;
}
$(this).button('disable').button('option', 'label', "Working...");
$('#mode').val('subtract');
$('#inventory-form').submit();
});
$('#inventory-form').submit(function() {
if (! assert_quantity()) {
return false;
}
disable_submit_button(this);
$(this).mask("Working...");
});
@ -200,7 +186,6 @@
<div class="form-wrapper">
${h.form(form.action_url, id='inventory-form')}
${h.csrf_token(request)}
${h.hidden('mode')}
<div class="field-wrapper">
<label for="upc">Product UPC</label>
@ -250,8 +235,7 @@
</div>
<div class="buttons">
<button type="button" id="add">Add</button>
<button type="button" id="subtract">Subtract</button>
${h.submit('submit', "Submit")}
</div>
${h.end_form()}