Show crafting plan button only when craftable

This commit is contained in:
Andrew Miner
2016-04-26 21:53:39 -07:00
parent 1d1772e961
commit 35bb12de6a
@@ -101,11 +101,12 @@ module.exports = class ItemPageController extends PageController
endEditing: => @_endEditingDescription() endEditing: => @_endEditingDescription()
enterFeedback: @_enterFeedback enterFeedback: @_enterFeedback
@$aboutImage = @$('.about img') @$aboutImage = @$('.about img')
@$name = @$('.about .title') @$craftingPlanButton = @$('.button.craftingPlan')
@$officialLink = @$('.about a.officialLink') @$name = @$('.about .title')
@$sourceModLink = @$('.about a.sourceMod') @$officialLink = @$('.about a.officialLink')
@$aboutLinks = @$('.about .right') @$sourceModLink = @$('.about a.sourceMod')
@$aboutLinks = @$('.about .right')
@$multiblockSection = @$('section.multiblock') @$multiblockSection = @$('section.multiblock')
@$recipeContainer = @$('section.recipes .panel') @$recipeContainer = @$('section.recipes .panel')
@@ -135,6 +136,11 @@ module.exports = class ItemPageController extends PageController
else else
@hide @$aboutLinks @hide @$aboutLinks
if @model.item.isCraftable
@show @$craftingPlanButton
else
@hide @$craftingPlanButton
@show() @show()
else else
@hide() @hide()