@@ -, +, @@ browser crash --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1354,13 +1354,15 @@ function highlightOn() { var x; for (x in q_array) { - q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1"); - q_array[x] = q_array[x].toLowerCase(); - var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|'); - if( $.inArray(q_array[x], myStopwords) == -1 ) { - $(".title").highlight(q_array[x]); - $(".author").highlight(q_array[x]); - $(".results_summary").highlight(q_array[x]); + if ( q_array[x].length > 0 ) { + q_array[x] = q_array[x].replace(/\w*:([\w])/, "$1"); + q_array[x] = q_array[x].toLowerCase(); + var myStopwords = "[% Koha.Preference('NotHighlightedWords') %]".toLowerCase().split('|'); + if( $.inArray(q_array[x], myStopwords) == -1 ) { + $(".title").highlight(q_array[x]); + $(".author").highlight(q_array[x]); + $(".results_summary").highlight(q_array[x]); + } } } $(".highlight_toggle").toggle(); --