Skip to content

Commit

Permalink
Hide items with item count of 0 (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
RolfKoenders authored and wchill committed Jul 30, 2016
1 parent 4cee7e1 commit 19b3e38
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,15 @@ var mapView = {

out = '<div class="items"><div class="row">';
for (var i = 0; i < current_user_bag_items.length; i++) {
out += '<div class="col s12 m6 l3 center" style="float: left"><img src="image/items/' +
current_user_bag_items[i].inventory_item_data.item.item_id +
'.png" class="item_img"><br><b>' +
self.itemsArray[current_user_bag_items[i].inventory_item_data.item.item_id] +
'</b><br>Count: ' +
(current_user_bag_items[i].inventory_item_data.item.count || 0) +
'</div>';
if(current_user_bag_items[i].inventory_item_data.item.count > 0) {
out += '<div class="col s12 m6 l3 center" style="float: left"><img src="image/items/' +
current_user_bag_items[i].inventory_item_data.item.item_id +
'.png" class="item_img"><br><b>' +
self.itemsArray[current_user_bag_items[i].inventory_item_data.item.item_id] +
'</b><br>Count: ' +
(current_user_bag_items[i].inventory_item_data.item.count || 0) +
'</div>';
}
}
out += '</div></div>';
var nth = 0;
Expand Down

0 comments on commit 19b3e38

Please sign in to comment.