Fix bug where "include tools" would always stay on

This commit is contained in:
Andrew Miner
2015-01-12 14:21:34 -08:00
parent fef9d155d8
commit 47c7cf693a
+3 -1
View File
@@ -16,7 +16,6 @@ module.exports = class CraftingPlan extends BaseModel
options.storage ?= window.localStorage
if not attributes.modPack then throw new Error 'modPack is required'
attributes.includingTools ?= options.storage.getItem('includingTools')
attributes.includingTools ?= false
super attributes, options
@@ -29,6 +28,9 @@ module.exports = class CraftingPlan extends BaseModel
@have.on 'change', => @craft()
@want.on 'change', => @craft()
@modPack.on 'change', => @craft()
value = options.storage.getItem('includingTools')
if value? then @includingTools = value is 'true'
@on 'change:includingTools', => @onIncludingToolsChanged()
@clear()