From f5650ee9e9cdc40286000aa3122a6295ba99254b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Michael=20O=2E=20Hegg=C3=B8?= Date: Tue, 12 Nov 2019 16:54:39 +0100 Subject: [PATCH] Fix "Any language" label not showing in edge case Fix an edge cases where the label "Any language" on the search bar language selection button shows as "Undefined" when the UI language is not a valid search language and no vocabulary has been selected. --- resource/js/docready.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resource/js/docready.js b/resource/js/docready.js index b451e8fff..70dae70ee 100644 --- a/resource/js/docready.js +++ b/resource/js/docready.js @@ -543,7 +543,7 @@ $(function() { // DOCUMENT READY } else if (!search_lang) { langPretty = $('a[hreflang=' + lang + ']').html(); search_lang = lang; - if (!langPretty) { langPretty = $('a[hreflang="anything"]').html(); } + if (!langPretty) { langPretty = $('.lang-button-all').html(); } $('#lang-dropdown-toggle').html(langPretty + ' '); qlang = lang; } else { @@ -558,7 +558,7 @@ $(function() { // DOCUMENT READY }); if (!search_lang_possible && search_lang !== 'anything') { - langPretty = $('a[hreflang=""]').html(); + langPretty = $('.lang-button-all').html(); $('#lang-dropdown-toggle').html(langPretty + ' '); qlang = ''; createCookie('SKOSMOS_SEARCH_LANG', qlang, 365);