Add "nothing" placeholder for empty inventories
This commit is contained in:
@@ -79,10 +79,11 @@ module.exports = class InventoryController extends BaseController
|
|||||||
modPack: @modPack,
|
modPack: @modPack,
|
||||||
onChoseItem: (itemSlug)=> @onItemChosen(itemSlug)
|
onChoseItem: (itemSlug)=> @onItemChosen(itemSlug)
|
||||||
|
|
||||||
@$clearButton = @$('button.clear')
|
@$clearButton = @$('button.clear')
|
||||||
@$icon = @$('.icon')
|
@$emptyPlaceholder = @$('.empty_placeholder')
|
||||||
@$itemContainer = @$('.item_container')
|
@$icon = @$('.icon')
|
||||||
@$title = @$('h2 p')
|
@$itemContainer = @$('.item_container')
|
||||||
|
@$title = @$('h2 p')
|
||||||
super
|
super
|
||||||
|
|
||||||
refresh: ->
|
refresh: ->
|
||||||
@@ -97,6 +98,11 @@ module.exports = class InventoryController extends BaseController
|
|||||||
|
|
||||||
@_refreshStacks()
|
@_refreshStacks()
|
||||||
|
|
||||||
|
if @model.isEmpty
|
||||||
|
@show @$emptyPlaceholder
|
||||||
|
else
|
||||||
|
@hide @$emptyPlaceholder
|
||||||
|
|
||||||
super
|
super
|
||||||
|
|
||||||
# Backbone.View Overrides ######################################################################
|
# Backbone.View Overrides ######################################################################
|
||||||
|
|||||||
@@ -7,5 +7,5 @@
|
|||||||
|
|
||||||
.view__inventory
|
.view__inventory
|
||||||
.item_container
|
.item_container
|
||||||
.empty_placeholder.hideable.hidden Empty
|
.empty_placeholder.hideable.hidden nothing
|
||||||
.view__item_selector.hideable.hidden.button: p add an item...
|
.view__item_selector.hideable.hidden.button: p add an item...
|
||||||
|
|||||||
@@ -7,6 +7,15 @@ All rights reserved.
|
|||||||
|
|
||||||
.view__inventory {
|
.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 {
|
.item_container {
|
||||||
position: relative; width: 100%;
|
position: relative; width: 100%;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user