refactors showSearchResults to be part of appState
This commit is contained in:
@@ -20,7 +20,8 @@ function appState($rootScope) {
|
||||
|
||||
var sectionState = {
|
||||
//The currently active section
|
||||
currentSection: null
|
||||
currentSection: null,
|
||||
showSearchResults: null
|
||||
};
|
||||
|
||||
var treeState = {
|
||||
|
||||
@@ -26,7 +26,6 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
|
||||
showContextMenu: false,
|
||||
stickyNavigation: false,
|
||||
showTray: false,
|
||||
showSearchResults: false,
|
||||
currentSection: undefined,
|
||||
currentPath: undefined,
|
||||
currentTree: undefined,
|
||||
@@ -79,7 +78,7 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
|
||||
ui.stickyNavigation = false;
|
||||
ui.showNavigation = true;
|
||||
ui.showContextMenu = false;
|
||||
ui.showSearchResults = true;
|
||||
appState.setSectionState("showSearchResults", true);
|
||||
appState.setMenuState("showMenu", false);
|
||||
|
||||
$timeout(function() {
|
||||
@@ -91,7 +90,7 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
|
||||
ui.currentMode = "default";
|
||||
ui.showContextMenu = false;
|
||||
appState.setMenuState("showMenu", false);
|
||||
ui.showSearchResults = false;
|
||||
appState.setSectionState("showSearchResults", false);
|
||||
ui.stickyNavigation = false;
|
||||
ui.showTray = false;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ function NavigationController($scope,$rootScope, $location, $log, $routeParams,
|
||||
|
||||
//set up our scope vars
|
||||
$scope.showContextMenuDialog = false;
|
||||
$scope.showSearchResults = false;
|
||||
|
||||
//wire up the screensize and tree mode detection
|
||||
navigationService.init();
|
||||
@@ -53,6 +54,13 @@ function NavigationController($scope,$rootScope, $location, $log, $routeParams,
|
||||
$scope.showContextMenuDialog = args.value;
|
||||
}
|
||||
});
|
||||
|
||||
//Listen for section state changes
|
||||
$scope.$on("appState.sectionState.changed", function (e, args) {
|
||||
if (args.key === "showSearchResults") {
|
||||
$scope.showSearchResults = args.value;
|
||||
}
|
||||
});
|
||||
|
||||
//This reacts to clicks passed to the body element which emits a global call to close all dialogs
|
||||
$rootScope.$on("closeDialogs", function (event) {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Search results -->
|
||||
<div id="search-results" class="umb-modalcolumn-body" ng-show="nav.ui.showSearchResults">
|
||||
<div id="search-results" class="umb-modalcolumn-body" ng-show="showSearchResults">
|
||||
|
||||
<ul class="umb-tree">
|
||||
<li class="root">
|
||||
|
||||
Reference in New Issue
Block a user