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 ######################################################################
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
|
||||
.view__inventory
|
||||
.item_container
|
||||
.empty_placeholder.hideable.hidden Empty
|
||||
.empty_placeholder.hideable.hidden nothing
|
||||
.view__item_selector.hideable.hidden.button: p add an item...
|
||||
|
||||
@@ -7,6 +7,15 @@ All rights reserved.
|
||||
|
||||
.view__inventory {
|
||||
|
||||
.empty_placeholder {
|
||||
color: $color-gray-light;
|
||||
font-family: $font-family-normal;
|
||||
font-size: $font-size-large;
|
||||
margin: 2em 0;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.item_container {
|
||||
position: relative; width: 100%;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user