Add "nothing" placeholder for empty inventories

This commit is contained in:
Andrew Miner
2015-04-20 11:26:21 -07:00
parent 01a137cdc6
commit cc67fce5a2
3 changed files with 20 additions and 5 deletions
@@ -79,10 +79,11 @@ module.exports = class InventoryController extends BaseController
modPack: @modPack,
onChoseItem: (itemSlug)=> @onItemChosen(itemSlug)
@$clearButton = @$('button.clear')
@$icon = @$('.icon')
@$itemContainer = @$('.item_container')
@$title = @$('h2 p')
@$clearButton = @$('button.clear')
@$emptyPlaceholder = @$('.empty_placeholder')
@$icon = @$('.icon')
@$itemContainer = @$('.item_container')
@$title = @$('h2 p')
super
refresh: ->
@@ -97,6 +98,11 @@ module.exports = class InventoryController extends BaseController
@_refreshStacks()
if @model.isEmpty
@show @$emptyPlaceholder
else
@hide @$emptyPlaceholder
super
# Backbone.View Overrides ######################################################################