Add "nothing" placeholder for empty inventories
This commit is contained in:
@@ -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 ######################################################################
|
||||
|
||||
Reference in New Issue
Block a user