Moke internal links use router

This commit is contained in:
Andrew Miner
2015-01-29 12:13:31 -08:00
parent cac523988e
commit d0fdbdf2c6
14 changed files with 94 additions and 41 deletions
@@ -47,6 +47,7 @@ module.exports = class ItemPageController extends BaseController
imageLoader: @_imageLoader
model: @model.plan.want
modPack: @model.modPack
onChange: => @_updateLocation()
title: 'Items you want'
@haveController = @addChild InventoryController, '.have',
@@ -90,3 +91,13 @@ module.exports = class ItemPageController extends BaseController
events:
'change .includeTools': 'onToolsBoxToggled'
# Private Methods ##############################################################################
_updateLocation: ->
list = @model.plan.want.toList()
if list.length is 1
slug = if _.isArray(list[0]) then list[0][1] else list[0]
router.navigate "/item/#{slug}"
else
router.navigate "/"