فهرست منبع

Graph: series override dropdown menu select did not work after recent commit that added typeahead to this dropdown

Torkel Ödegaard 11 سال پیش
والد
کامیت
b85fe62389
2فایلهای تغییر یافته به همراه12 افزوده شده و 1 حذف شده
  1. 11 0
      src/app/directives/dropdown.typeahead.js
  2. 1 1
      src/app/panels/graph/seriesOverridesCtrl.js

+ 11 - 0
src/app/directives/dropdown.typeahead.js

@@ -37,6 +37,17 @@ function (angular, app, _, $) {
             return memo;
           }, []);
 
+          $scope.menuItemSelected = function(optionIndex, valueIndex) {
+            var option = $scope.menuItems[optionIndex];
+            var result = {
+              $item: option.submenu[valueIndex],
+              $optionIndex: optionIndex,
+              $valueIndex: valueIndex
+            };
+
+            $scope.dropdownTypeaheadOnSelect(result);
+          };
+
           $input.attr('data-provide', 'typeahead');
           $input.typeahead({
             source: typeaheadValues,

+ 1 - 1
src/app/panels/graph/seriesOverridesCtrl.js

@@ -23,7 +23,7 @@ define([
       option.submenu = _.map(values, function(value, index) {
         return {
           text: String(value),
-          click: 'setOverride(' + option.index + ',' + index + ')'
+          click: 'menuItemSelected(' + option.index + ',' + index + ')'
         };
       });