Senpai Silox Styling Suggestions
This commit is contained in:
parent
33b797b5d9
commit
24f9531192
2 changed files with 4 additions and 4 deletions
|
@ -20,7 +20,7 @@ ready = ->
|
|||
|
||||
|
||||
# Validate input, and then update
|
||||
updateInput = (row, useRecalculate = true)->
|
||||
updateInput = (row, useRecalculate = true) ->
|
||||
cell = row.querySelector("input")
|
||||
if ! cell.validity.valid
|
||||
if(parseInt(cell.value) > parseInt(cell.max))
|
||||
|
@ -50,8 +50,8 @@ increment = (button, n) ->
|
|||
# Fix the counter
|
||||
counter = $(row).find('.row_counter')
|
||||
value = parseInt(counter.val())
|
||||
# Apparently CoffeeScript doesn't support ?:
|
||||
value = if isNaN(value) then 0 else value
|
||||
if isNaN(value)
|
||||
value = 0
|
||||
counter.val(value + n)
|
||||
|
||||
updateInput(row[0])
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<%= content_tag :span, product.name %>
|
||||
<%= content_tag :small, euro(product.price) %>
|
||||
</h4>
|
||||
<%= f.counter :count, max: product.stock, min:0, skip_label: true, wrapper_class: "input-group", class: "row_counter" %>
|
||||
<%= f.counter :count, min: 0, max: product.stock, skip_label: true, wrapper_class: "input-group", class: "row_counter" %>
|
||||
<%= f.fields_for :product do |product| %>
|
||||
<%= product.hidden_field :price_cents, class: :price %>
|
||||
<%= product.hidden_field :stock, class: :stock %>
|
||||
|
|
Loading…
Reference in a new issue