Skip to content

Commit

Permalink
js: Fix card recategorization in decklists
Browse files Browse the repository at this point in the history
NRDB appears to have removed alt text from decklist category headers,
so the method has been tweaked to look at a different field to
determine the category.
  • Loading branch information
csbisa committed Apr 2, 2024
1 parent 9b6f06b commit dd716ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nrdb-language-override.js.tail.in
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ function moveCardCategory(parent, type, dest, child, source) {
dest.appendChild(child)
var count = parseInt(child.innerHTML.split('x')[0])
Array.from(parent.getElementsByTagName('h5')).forEach(elem => {
if (elem.children[0].alt == type) {
if (elem.children[0].attributes["aria-label"].value == type) {
var old_count = parseInt(elem.children[1].innerHTML) || 0
elem.children[1].innerHTML = old_count + count
if (old_count == 0) {
elem.setAttribute("style", "")
}
} else if (elem.children[0].alt == source) {
} else if (elem.children[0].attributes["aria-label"].value == source) {
var old_count = parseInt(elem.children[1].innerHTML)
elem.children[1].innerHTML = old_count - count
if ((old_count - count) == 0) {
Expand Down

0 comments on commit dd716ea

Please sign in to comment.