Преглед изворни кода

[search] Fix refresh of group by option of histogram

Romain Rigaux пре 11 година
родитељ
комит
039b0def9d

+ 6 - 5
apps/search/src/search/templates/search2.mako

@@ -360,8 +360,9 @@ ${ commonheader(_('Search'), "search", user, "60px") | n,unicode }
       <!--[if !IE]> --><i class="fa fa-spinner fa-spin"></i><!-- <![endif]-->
       <!--[if IE]><img src="/static/art/spinner.gif" /><![endif]-->
     </div>
-	  <!-- /ko -->
-	  <!-- ko if: ! $root.collection.template.isGridLayout() -->
+	<!-- /ko -->
+	  
+	<!-- ko if: ! $root.collection.template.isGridLayout() -->
 	  <div id="result-container" data-bind="foreach: $root.results">
 	    <div class="result-row" data-bind="html: $data"></div>
 	  </div>
@@ -402,8 +403,8 @@ ${ commonheader(_('Search'), "search", user, "60px") | n,unicode }
     ##<a href="javascript:void(0)"><i class="fa fa-plus"></i></a>
     <a href="javascript:void(0)" data-bind="click: $root.collection.timeLineZoom"><i class="fa fa-minus"></i></a>
     <span>
-      Group By
-      <select data-bind="options: $root.query.multiqs, optionsText: 'label', value: $root.query.selectedMultiq">
+      ${ _('Group By') }
+      <select data-bind="options: $root.query.multiqs, optionsValue: 'id',optionsText: 'label', value: $root.query.selectedMultiq">
       </select>      
     </span>
 
@@ -1051,7 +1052,7 @@ $(document).ready(function () {
       if (_existingFacet != null) {
         _existingFacet.label(field.name());
         _existingFacet.field(field.name());
-      }
+      }      
       viewModel.search();
     }
   }

+ 0 - 1
apps/search/src/search/views.py

@@ -576,7 +576,6 @@ def get_range_facet(request):
     result['status'] = 0      
 
   except Exception, e:
-    print e
     result['message'] = unicode(str(e), "utf8")
 
   return HttpResponse(json.dumps(result), mimetype="application/json")

+ 2 - 2
apps/search/static/js/search.ko.js

@@ -214,8 +214,8 @@ var Query = function (vm, query) {
     }
 	return false;
   });
-  self.selectedMultiq.subscribe(function () { // To keep below the computed
-    vm.search();
+  self.selectedMultiq.subscribe(function (c) { // To keep below the computed
+	vm.search();
   });
   
   self.toggleFacet = function (data) {