mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(search): fixes broken esc button in search
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user