Commit f3845389 by bergquist

fix(search): fixes broken esc button in search

parent 0b05d398
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment