fix(search): fixes broken esc button in search

This commit is contained in:
bergquist
2016-01-26 23:18:10 +01:00
parent 0b05d39804
commit f384538959
2 changed files with 6 additions and 3 deletions

View File

@@ -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: '&'
},
};
}

View File

@@ -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);