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

+ 2 - 1
apps/search/src/search/templates/search.mako

@@ -735,7 +735,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
           viewModel.query.toggleFacet({facet: d.obj, widget_id: d.obj.widget_id});
         } 
       },
-      onSelectRange: function(from, to){ viewModel.collection.selectTimelineFacet({from: from, to: to, cat: field, widget_id: d.obj.widget_id}) },
+      onSelectRange: function(from, to){ viewModel.collection.selectTimelineFacet({from: from, to: to, cat: field, widget_id: id}) },
       onComplete: function(){ viewModel.getWidgetById(id).isLoading(false) } }"
     />
   </div>
@@ -859,6 +859,7 @@ ${ commonheader(_('Search'), "search", user, "80px") | n,unicode }
       <div data-bind="mapChart: {data: {counts: $parent.counts, scope: $root.collection.getFacetById($parent.id).properties.scope()},
         transformer: mapChartDataTransformer,
         maxWidth: 750,
+        isScale: true,
         onClick: function(d){ viewModel.query.toggleFacet({facet: d, widget_id: $parent.id}) },
         onComplete: function(){ viewModel.getWidgetById($parent.id).isLoading(false)} }" />
     </div>

+ 5 - 4
apps/search/static/js/charts.ko.js

@@ -122,19 +122,20 @@ ko.bindingHandlers.mapChart = {
     var _noncountries = [];
 
     if (_options.isScale) {
-      _fills["defaultFill"] = HueColors.LIGHT_BLUE;
+      _fills["defaultFill"] = HueColors.WHITE;
       var _colors = HueColors.scale(HueColors.LIGHT_BLUE, HueColors.DARK_BLUE, _data.length);
       $(_colors).each(function(cnt, item) {
         _fills["fill_" + cnt] = item;
       });
       $(_data).each(function(cnt, item) {
-        var _place = item.label;
+        var _place = item.label.toUpperCase();
         if (_place != null){
           _mapdata[_place] = {
-            fillKey: "fill_" + Math.floor(item.value / _chunk),
+            fillKey: "fill_" + (Math.floor(item.value / _chunk) - 1),
             id: _place,
             cat: item.obj.cat,
-            value: item.obj.value
+            value: item.obj.value,
+            selected: item.obj.selected
           };
           _maphovers[_place] = item.value;
         }

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

@@ -327,7 +327,7 @@ var Query = function (vm, query) {
         self.fqs.remove(fq);
         // Also re-init range select widget
         var rangeWidget = vm.collection.getFacetById(fq.id());
-        if (rangeWidget != null && RANGE_SELECTABLE_WIDGETS.indexOf(rangeWidget.widgetType()) != -1) {
+        if (rangeWidget != null && RANGE_SELECTABLE_WIDGETS.indexOf(rangeWidget.widgetType()) != -1 && fq.type() == 'range') {
           vm.collection.timeLineZoom({'id': rangeWidget.id()});	
         }
         return false;

+ 2 - 1
desktop/core/static/js/hue.colors.js

@@ -54,5 +54,6 @@ var HueColors = {
   DARK_BLUE: "#338BB8",
   DARKER_BLUE: "#205875",
   PURPLE: "#C0B1E9",
-  GRAY: "#666666"
+  GRAY: "#666666",
+  WHITE: "#FFFFFF",
 };