Allow up to 9999 of a single item stack

This commit is contained in:
Andrew Miner
2015-02-24 17:59:03 -08:00
parent 0652fdda09
commit 14a7344fcd
@@ -16,6 +16,8 @@ StackController = require './stack_controller'
module.exports = class InventoryController extends BaseController
@MAX_QUANTITY = 9999
@ONLY_DIGITS = /^[0-9]*$/
constructor: (options={})->
@@ -85,7 +87,7 @@ module.exports = class InventoryController extends BaseController
onQuantityFieldBlur: ->
value = @$quantityField.val().replace /[^0-9]/g, ''
if value.length is 0 then value = '1'
value = Math.min value, 64
value = Math.min value, InventoryController.MAX_QUANTITY
@$quantityField.val value
@onQuantityFieldChanged()