Store want/have in URL/local storage

This commit is contained in:
Andrew Miner
2015-01-31 15:48:24 -08:00
parent 6d63824d76
commit e0c642e787
6 changed files with 79 additions and 45 deletions
+11 -3
View File
@@ -62,11 +62,19 @@ module.exports = class CraftingGuideRouter extends Backbone.Router
root: ->
params = new UrlParams recipeName:{type:'string'}, count:{type:'integer'}
@item params.recipeName, params.count
item: (name, quantity=1)->
arg = null
if params.recipeName?
if params.count?
arg = "#{params.count}:#{params.recipeName}"
else
arg = "#{params.recipeName}"
@item arg
item: (inventoryText)->
controller = new ItemPageController @_defaultOptions
controller.model.params = name:name, quantity:quantity
controller.model.params = inventoryText:inventoryText
@_setPage 'item', controller
mod: (slug)->