فهرست منبع

Added onblur and fixed quote escaping. Closes #228 closes #232

Rashid Khan 12 سال پیش
والد
کامیت
dce884f526
3فایلهای تغییر یافته به همراه15 افزوده شده و 5 حذف شده
  1. 11 1
      js/directives.js
  2. 3 3
      panels/filtering/module.html
  3. 1 1
      panels/table/module.js

+ 11 - 1
js/directives.js

@@ -68,5 +68,15 @@ angular.module('kibana.directives', [])
       });
     }
   };
-});
+})
+.directive('ngBlur', ['$parse', function($parse) {
+  return function(scope, element, attr) {
+    var fn = $parse(attr['ngBlur']);
+    element.bind('blur', function(event) {
+      scope.$apply(function() {
+        fn(scope, {$event:event});
+      });
+    });
+  }
+}]);
 

+ 3 - 3
panels/filtering/module.html

@@ -39,9 +39,9 @@
         <strong>{{filterSrv.list[id].type}}</strong> 
         <span ng-show="!filterSrv.list[id].editing" class="filter-mandate" ng-click="filterSrv.list[id].editing = true">{{filterSrv.list[id].mandate}}</span>
 
-        <span class="small" ng-show="filterSrv.list[id].editing">
-          <select class="input-small" ng-model="filterSrv.list[id].mandate" ng-options="f for f in ['must','mustNot','either']" ng-change='filterSrv.list[id].editing=undefined;refresh()'></select>
-          <i class="pointer icon-remove" bs-tooltip="'Cancel  '" ng-click="filterSrv.list[id].editing=undefined"></i>
+        <span ng-show="filterSrv.list[id].editing">
+          <select class="input-small" ng-model="filterSrv.list[id].mandate" ng-options="f for f in ['must','mustNot','either']" ng-change='filterSrv.list[id].editing=undefined;refresh()' ng-blur="filterSrv.list[id].editing=undefined"></select>
+          <i class="pointer icon-remove" bs-tooltip="'Cancel '" ng-click="filterSrv.list[id].editing=undefined"></i>
         </span>
 
         <i class="filter-action pointer icon-remove" bs-tooltip="'Remove'" ng-click="remove(id)"></i>

+ 1 - 1
panels/table/module.js

@@ -110,7 +110,7 @@ angular.module('kibana.table', [])
     var query;
     // This needs to be abstracted somewhere
     if(_.isArray(value)) {
-      query = field+":(" + _.map(value,function(v){return "\""+v+"\""}).join(",") + ")";
+      query = field+":(" + _.map(value,function(v){return angular.toJson("\""+v+"\"")}).join(",") + ")";
     } else {
       query = field+":"+angular.toJson(value);
     }