diff --git a/main.js b/main.js index bd82f43..8bd30f2 100644 --- a/main.js +++ b/main.js @@ -367,7 +367,7 @@ function Put(list, key, value) { game[list.id].push([key,value]); } - PutUI(list, key, value); + list.PutUI(key, value); if (key === 'STR') EncumBar.reset(10 + value, EncumBar.Position()); @@ -382,15 +382,6 @@ function Put(list, key, value) { } -function PutUI(list, key, value) { - // Update UI - var item = list.item(key); - item.children().last().text(value); - item.addClass("selected"); - item.each(function () {this.scrollIntoView();}); -} - - function ProgressBar(id, tmpl) { this.id = id; this.bar = $("#"+ id + " > .bar"); @@ -462,15 +453,18 @@ function ListBox(id, columns, fixedkeys) { this.box.find("tr").removeClass("selected"); }; - this.item = function (key) { - var result = this.rows().filter(function (index) { + this.PutUI = function (key, value) { + var item = this.rows().filter(function (index) { return Key(this) === key; }); - if (!result.length) { - result = $("