From 9045cd7468c18050e058dfcf36700473b781700d Mon Sep 17 00:00:00 2001 From: Simon Alm Liljevall Date: Mon, 27 Mar 2017 11:05:39 +0200 Subject: [PATCH 1/3] Fix input field for Firefox --- viewer/static/js/es6/utils/search.es6 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/viewer/static/js/es6/utils/search.es6 b/viewer/static/js/es6/utils/search.es6 index 6c99fee41..81e258fb8 100644 --- a/viewer/static/js/es6/utils/search.es6 +++ b/viewer/static/js/es6/utils/search.es6 @@ -70,14 +70,14 @@ export function doSearch() { const searchField = document.querySelector('#searchQsmart'); for (const node of searchField.childNodes) { if (node.className.split(' ').indexOf('searchtag') > -1) { - const tag = node.innerHTML.split(':'); + const tag = node.innerText.split(':'); if (validTags.indexOf(tag[0].toLowerCase()) > -1) { tagObject[tag[0]] = tag[1]; } else { queryText.push(tag[1]); } - } else if (node.innerHTML !== '') { - queryText.push(`${node.innerHTML}`); + } else if (node.innerText !== '') { + queryText.push(`${node.innerText}`); } } tagObject.q = queryText.join(' '); @@ -139,6 +139,7 @@ export function searchFieldBehaviour(e, state, searchField) { } else { nextPhrase.focus(); } + return false; } else if (e.keyCode === 8 && // Backspace !tagEditing && currentPhrase.innerHTML === '' && @@ -153,6 +154,7 @@ export function searchFieldBehaviour(e, state, searchField) { const oldPhrase = searchField.children[state.counter]; searchField.removeChild(oldPhrase); previousPhrase.focus(); + return false; } } From 197e63aa2b7b0da565ab79d21dec9d591325ed62 Mon Sep 17 00:00:00 2001 From: Ola Blissing Date: Mon, 27 Mar 2017 11:23:00 +0200 Subject: [PATCH 2/3] Join labels when in list --- viewer/templates/search.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/viewer/templates/search.html b/viewer/templates/search.html index 786165bd8..b09fe9824 100644 --- a/viewer/templates/search.html +++ b/viewer/templates/search.html @@ -246,7 +246,11 @@ % elif observation.object.prefLabelByLang and observation.object.prefLabelByLang.sv
  • - ${observation.object.prefLabelByLang.sv | truncate(30, true) } + % if isinstance(observation.object.prefLabelByLang.sv, list) + ${observation.object.prefLabelByLang.sv | join(', ') | truncate(30, true) } + % else + ${observation.object.prefLabelByLang.sv | truncate(30, true) } + % endif (${observation.totalItems})
  • From 31148ab64f93cbed6e72f48b5cea811bec259ed9 Mon Sep 17 00:00:00 2001 From: Ola Blissing Date: Mon, 27 Mar 2017 11:30:58 +0200 Subject: [PATCH 3/3] Fix facet titles when only labelByLang --- viewer/templates/search.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/viewer/templates/search.html b/viewer/templates/search.html index b09fe9824..6d9b5eaeb 100644 --- a/viewer/templates/search.html +++ b/viewer/templates/search.html @@ -254,6 +254,17 @@ (${observation.totalItems}) + % elif observation.object.labelByLang and observation.object.labelByLang.sv +
  • + + % if isinstance(observation.object.labelByLang.sv, list) + ${observation.object.labelByLang.sv | join(', ') | truncate(30, true) } + % else + ${observation.object.labelByLang.sv | truncate(30, true) } + % endif + + (${observation.totalItems}) +
  • % endif % endfor