From 6890355854da82726496792c8e6b0b631dbf86e8 Mon Sep 17 00:00:00 2001 From: Ian Beacall Date: Sun, 2 Jun 2024 16:27:22 +0900 Subject: [PATCH] Update surname_table.js --- src/features/surname_table/surname_table.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/features/surname_table/surname_table.js b/src/features/surname_table/surname_table.js index c575799a..5a93e1ce 100644 --- a/src/features/surname_table/surname_table.js +++ b/src/features/surname_table/surname_table.js @@ -406,7 +406,7 @@ async function initSurnameTableSorting() { $(this).attr("data-birth-location-small2big", birthLocation); const deathDate = deathDateMatch ? deathDateMatch[0] : ""; - const deathLocation = deathLocationMatch ? deathLocationMatch[1] : ""; + let deathLocation = deathLocationMatch ? deathLocationMatch[1] : ""; $(this).attr("data-death-location-small2big", deathLocation); // Proceed to create and insert new elements as before @@ -415,11 +415,14 @@ async function initSurnameTableSorting() { birthLocationTD.insertAfter(birthTD); let deathLocationTD = null; - if (deathLocation) { - deathLocationTD = $("").html(deathLocation); - deathTD.html(deathDate); - deathLocationTD.insertAfter(deathTD); + if (deathLocation == null) { + deathLocation = ""; } + //if (deathLocation || deathDate) { + deathLocationTD = $("").html(deathLocation); + deathTD.html(deathDate); + deathLocationTD.insertAfter(deathTD); + //} } $(this).attr("data-birth-location-big2small", birthLocation.trim().split(", ").reverse().join(", ")); });