|
@@ -1,6 +1,7 @@
|
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
|
import coreModule from '../../core_module';
|
|
import coreModule from '../../core_module';
|
|
|
import { SearchSrv } from 'app/core/services/search_srv';
|
|
import { SearchSrv } from 'app/core/services/search_srv';
|
|
|
|
|
+import appEvents from 'app/core/app_events';
|
|
|
|
|
|
|
|
export class SearchCtrl {
|
|
export class SearchCtrl {
|
|
|
isOpen: boolean;
|
|
isOpen: boolean;
|
|
@@ -16,9 +17,9 @@ export class SearchCtrl {
|
|
|
initialFolderFilterTitle: string;
|
|
initialFolderFilterTitle: string;
|
|
|
|
|
|
|
|
/** @ngInject */
|
|
/** @ngInject */
|
|
|
- constructor($scope, private $location, private $timeout, private searchSrv: SearchSrv, $rootScope) {
|
|
|
|
|
- $rootScope.onAppEvent('show-dash-search', this.openSearch.bind(this), $scope);
|
|
|
|
|
- $rootScope.onAppEvent('hide-dash-search', this.closeSearch.bind(this), $scope);
|
|
|
|
|
|
|
+ constructor($scope, private $location, private $timeout, private searchSrv: SearchSrv) {
|
|
|
|
|
+ appEvents.on('show-dash-search', this.openSearch.bind(this), $scope);
|
|
|
|
|
+ appEvents.on('hide-dash-search', this.closeSearch.bind(this), $scope);
|
|
|
|
|
|
|
|
this.initialFolderFilterTitle = "All";
|
|
this.initialFolderFilterTitle = "All";
|
|
|
}
|
|
}
|
|
@@ -74,6 +75,7 @@ export class SearchCtrl {
|
|
|
if (selectedDash) {
|
|
if (selectedDash) {
|
|
|
this.$location.search({});
|
|
this.$location.search({});
|
|
|
this.$location.path(selectedDash.url);
|
|
this.$location.path(selectedDash.url);
|
|
|
|
|
+ this.closeSearch();
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
const selectedFolder = this.results[currentItem.folderIndex];
|
|
const selectedFolder = this.results[currentItem.folderIndex];
|