Correct several small bugs found in user testing

* The "Show Plan for Tools" link should open a new window each time
    it is clicked (i.e., don't re-use the same window)
  * Further customize the title of the crafting page to give some
    indication of what is being crafted
This commit is contained in:
Andrew Miner
2016-04-25 21:54:28 -07:00
parent 31f4594928
commit 2c77972073
3 changed files with 20 additions and 3 deletions
@@ -60,7 +60,9 @@ module.exports = class CraftPageController extends PageController
return c.text.craftDescription()
getTitle: ->
return 'Craft'
description = @model.craftsman.want.toDescription()
return null unless description?
return "Crafting Plan for #{description}"
# BaseController Overrides #####################################################################
@@ -114,6 +116,8 @@ module.exports = class CraftPageController extends PageController
@model.craftsman.have.clear()
@model.craftsman.have.parse @_storage.load('crafting-plan:have')
@model.craftsman.have.on c.event.change, => @onHaveInventoryChanged()
@model.craftsman.want.on c.event.change, => @refresh()
super
refresh: ->
@@ -99,8 +99,9 @@ module.exports = class StepController extends BaseController
inventory.add toolStack.itemSlug, toolStack.quantity
inventory.localize()
@$toolButton.attr 'href', "/craft/#{inventory.unparse()}"
@$toolButton.attr 'target', 'new'
inventoryText = inventory.unparse()
@$toolButton.attr 'href', "/craft/#{inventoryText}"
@$toolButton.attr 'target', inventoryText
if @canAddTools this
@$toolButton.removeClass 'disabled'