Browse Source

hide the bestbet bento if there are no results

2.x
Paul Pound 2 years ago
parent
commit
3dd4c3f665
  1. 1
      modules/solr_site/js/solr_site_bestbet.js
  2. 2
      modules/solr_site/templates/roblib-search-solr-site-bestbet.html.twig

1
modules/solr_site/js/solr_site_bestbet.js

@ -10,6 +10,7 @@ Drupal.behaviors.roblib_search_solr_bestbet_results = {
if (total_found < 1) { if (total_found < 1) {
jQuery('#' + 'roblib-search-content-solr-site-bestbet').empty().append('No Results'); jQuery('#' + 'roblib-search-content-solr-site-bestbet').empty().append('No Results');
jQuery('.' + 'pane-roblib-search-solr-site-roblib-search-solr-site-bestbet').hide();
jQuery('.' + 'pane-roblib-search-solr-site-roblib-search-solr-site-' . solrType).hide(); jQuery('.' + 'pane-roblib-search-solr-site-roblib-search-solr-site-' . solrType).hide();
} else { } else {
jQuery('#' + 'roblib-search-content-solr-site-bestbet').empty(); jQuery('#' + 'roblib-search-content-solr-site-bestbet').empty();

2
modules/solr_site/templates/roblib-search-solr-site-bestbet.html.twig

@ -1,5 +1,5 @@
<div class="panel-pane pane-block pane-roblib-search-solr-site-roblib-search-solr-site-bestbet pane-roblib-search-solr-site"> <div class="panel-pane pane-block pane-roblib-search-solr-site-roblib-search-solr-site-bestbet pane-roblib-search-solr-site">
<div class="roblib-search-header roblib-search-solr-bestbet-header"><h3>Best Bet</h3></div> <div class="roblib-search-header roblib-search-solr-bestbet-header" id="roblib-search-solr-site-bestbet-title"><h3>Best Bet</h3></div>
<div class ="roblib-search-more" id="roblib-search-solr-site-{{ solr_type }}-more"></div> <div class ="roblib-search-more" id="roblib-search-solr-site-{{ solr_type }}-more"></div>
<div class ="roblib-search-content solr-site-{{ solr_type }}" id="roblib-search-content-solr-site-{{ solr_type }}"> <div class ="roblib-search-content solr-site-{{ solr_type }}" id="roblib-search-content-solr-site-{{ solr_type }}">
<img src="{{ spinner_path }}"/> <img src="{{ spinner_path }}"/>

Loading…
Cancel
Save