Browse Source

Fixes #88

tags/v0.1.2^2
Big Bad Waffle 7 years ago
parent
commit
ef421be80a
2 changed files with 17 additions and 2 deletions
  1. +7
    -0
      src/client/ui/templates/trade/template.html
  2. +10
    -2
      src/client/ui/templates/trade/trade.js

+ 7
- 0
src/client/ui/templates/trade/template.html View File

@@ -1,3 +1,10 @@
<div class="uiTrade uiInventory">
<div class="heading">
<div class="heading-text">trade</div>
</div>
<div class="stats">
<div class="list"></div>
</div>
<div class="grid"></div>
<div class="tooltip"></div>
</div>

+ 10
- 2
src/client/ui/templates/trade/trade.js View File

@@ -23,6 +23,8 @@ define([
},

onGetTradeList: function(itemList, action) {
this.find('.heading-text').html(action);

var uiInventory = $('.uiInventory').data('ui');

var container = this.el.find('.grid')
@@ -54,8 +56,14 @@ define([
return 0;
});

var iLen = buyItems.length;
var iLen = Math.max(buyItems.length, 50);
for (var i = 0; i < iLen; i++) {
if (!buyItems[i]) {
$(tplItem).appendTo(container);

continue;
}

var item = $.extend(true, {}, buyItems[i]);
item.worth = ~~(itemList.markup * item.worth);

@@ -74,7 +82,7 @@ define([
}

var imgX = (-item.sprite[0] * size) + offset;
var imgY = (-item.sprite[1] * size) + offset + 4;
var imgY = (-item.sprite[1] * size) + offset;

var itemEl = $(tplItem)
.appendTo(container);


Loading…
Cancel
Save