From 9b3a867c35ac68a1e7f4c96cf4ace5728b6fb855 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 30 Oct 2023 22:23:25 +0100 Subject: Fix JS regression dropdown label (#5785) #fix https://github.com/FreshRSS/FreshRSS/issues/5784 --- p/scripts/main.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'p/scripts') diff --git a/p/scripts/main.js b/p/scripts/main.js index 93aac281e..42d7aeef4 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -854,7 +854,7 @@ function init_column_categories() { const itemId = a.closest('.item').id; const templateId = itemId.substring(0, 2) === 't_' ? 'tag_config_template' : 'feed_config_template'; const id = itemId.substr(2); - const feed_web = a.getAttribute('data-fweb'); + const feed_web = a.getAttribute('data-fweb') || ''; const div = a.parentElement; const dropdownMenu = div.querySelector('.dropdown-menu'); const template = document.getElementById(templateId) @@ -863,8 +863,11 @@ function init_column_categories() { a.href = '#dropdown-' + id; div.querySelector('.dropdown-target').id = 'dropdown-' + id; div.insertAdjacentHTML('beforeend', template); - if (feed_web.length < 1) { - div.querySelector('.item.link.website').remove(); + if (feed_web == '') { + const website = div.querySelector('.item.link.website'); + if (website) { + website.remove(); + } } const b = div.querySelector('button.confirm'); if (b) { -- cgit v1.2.3