Browse Source

fix link to all solr results when query in quotes

2.x
Paul Pound 1 year ago
parent
commit
2757e95490
  1. 7
      modules/solr_site/js/solr_site_results.js

7
modules/solr_site/js/solr_site_results.js

@ -1,7 +1,8 @@
Drupal.behaviors.roblib_search_solr_site_results = { Drupal.behaviors.roblib_search_solr_site_results = {
attach: function (context, settings) { attach: function (context, settings) {
if (context == document) { if (context == document) {
query = drupalSettings.path.currentPath.replace('roblib_search/', ''); unencoded_query = drupalSettings.path.currentPath.replace('roblib_search/', '');
query = encodeURIComponent(unencoded_query);
solrUrl = settings.solr_site_search_url + query; solrUrl = settings.solr_site_search_url + query;
baseUrl = settings.solr_site_base_url + query; baseUrl = settings.solr_site_base_url + query;
jQuery.getJSON(baseUrl, function (data) { jQuery.getJSON(baseUrl, function (data) {
@ -28,9 +29,9 @@ Drupal.behaviors.roblib_search_solr_site_results = {
jQuery('#' + 'roblib-search-content-solr-site-results').empty().append(items.join('')); jQuery('#' + 'roblib-search-content-solr-site-results').empty().append(items.join(''));
} }
if (total_found > 0) { if (total_found > 0) {
results_url = '<a href="' + solrUrl + '">see all results (' results_url = '<a href=\'' + solrUrl + '\'>see all results ('
+ total_found + ') </a>'; + total_found + ') </a>';
move_me_div_url = '<a href="' + solrUrl + '">Library Site (' move_me_div_url = '<a href=\'' + solrUrl + '\'>Library Site ('
+ total_found + ') </a>'; + total_found + ') </a>';
jQuery('#' + 'roblib-search-solr-site-results-more').empty().append(results_url); jQuery('#' + 'roblib-search-solr-site-results-more').empty().append(results_url);
jQuery('#' + 'roblib-solr-more-results-results').empty().append(results_url); jQuery('#' + 'roblib-solr-more-results-results').empty().append(results_url);

Loading…
Cancel
Save