Work on the register UI

This commit is contained in:
nikolark committed 2012-01-07 03:36:12 +01:00
1 parent 7a15006455
commit 135fe821e1
16 files changed
+290 -167

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
$(document).ready(function() {
/* Customer selection */
$("li.customer").click( function() {
/* Enable all buttons */
$("li.customer").each(function(i) {
$(this).removeClass("selected");
});
/* Disable the customer button just clicked */
$(this).addClass("selected");
/* Update the form */
$("input[name=customer]").val($(this).children("span.name").text());
});
/* Product amount controls */
$("li.product").click( function() {
var form_field = $(this).children("input[type=text]");
var qty = Number(form_field.val()) + 1;
form_field.val(qty);
});
/* Also reset the hidden customer fields */
$("input[type=reset]").click( function() {
$("input[name=customer]").val("");
});
/* TODO: keyboard shortcuts */
});