Bring up to date using make_elem
This commit is contained in:
parent
57c6426d50
commit
68c27b5224
1 changed files with 4 additions and 10 deletions
14
js/items.js
14
js/items.js
|
@ -121,15 +121,11 @@ function displayItems(items_copy) {
|
||||||
for (let i in items_copy) {
|
for (let i in items_copy) {
|
||||||
if (i > 200) {break;}
|
if (i > 200) {break;}
|
||||||
let item = items_copy[i].itemExp;
|
let item = items_copy[i].itemExp;
|
||||||
let box = document.createElement("div");
|
let box = make_elem('div', ['col-lg-3', 'col-sm-6', 'p-2'], {id: 'item'+i});
|
||||||
box.classList.add("col-lg-3", "col-sm-6", "p-2");
|
|
||||||
box.id = "item"+i;
|
|
||||||
//box.addEventListener("dblclick", function() {set_item(item);}); TODO: ??
|
//box.addEventListener("dblclick", function() {set_item(item);}); TODO: ??
|
||||||
|
|
||||||
let bckgrdbox = document.createElement("div");
|
let bckgrdbox = make_elem("div", ["dark-7", "rounded", "px-2", "col-auto"], {id: 'item'+i+'b'});
|
||||||
bckgrdbox.classList.add("dark-7", "rounded", "px-2", "col-auto");
|
box.append(bckgrdbox);
|
||||||
box.appendChild(bckgrdbox);
|
|
||||||
bckgrdbox.id = "item"+i+"b";
|
|
||||||
items_parent.appendChild(box);
|
items_parent.appendChild(box);
|
||||||
item.set("powders", []);
|
item.set("powders", []);
|
||||||
if (item.get("category") == "weapon") {
|
if (item.get("category") == "weapon") {
|
||||||
|
@ -263,9 +259,7 @@ function init_items() {
|
||||||
list.style.maxHeight = position.height * 4 +"px";
|
list.style.maxHeight = position.height * 4 +"px";
|
||||||
|
|
||||||
if (!data.results.length) {
|
if (!data.results.length) {
|
||||||
message = document.createElement('li');
|
const message = make_elem('li', ['scaled-font'], {textContent: "No results found!"});
|
||||||
message.classList.add('scaled-font');
|
|
||||||
message.textContent = "No results found!";
|
|
||||||
list.prepend(message);
|
list.prepend(message);
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue