fix(search): fixes broken esc button in search

pull/3860/head
bergquist 9 years ago
parent 0b05d39804
commit f384538959
  1. 7
      public/app/core/components/search/search.ts
  2. 2
      public/app/features/dashboard/directives/dashSearchView.js

@ -14,6 +14,7 @@ export class SearchCtrl {
currentSearchId: number;
tagsMode: boolean;
showImport: boolean;
dismiss: any;
/** @ngInject */
constructor(private $scope, private $location, private $timeout, private backendSrv, private contextSrv) {
@ -32,7 +33,7 @@ export class SearchCtrl {
keyDown(evt) {
if (evt.keyCode === 27) {
this.$scope.dismiss();
this.dismiss();
}
if (evt.keyCode === 40) {
this.moveSelection(1);
@ -137,7 +138,9 @@ export function searchDirective() {
controller: SearchCtrl,
bindToController: true,
controllerAs: 'ctrl',
scope: {},
scope: {
dismiss: '&'
},
};
}

@ -29,7 +29,7 @@ function (angular, $) {
editorScope = null;
};
var view = $('<search class="search-container"></search>');
var view = $('<search class="search-container" dismiss="dismiss()"></search>');
elem.append(view);
$compile(elem.contents())(editorScope);

Loading…
Cancel
Save