Fixes missing section state indicator

This commit is contained in:
perploug
2013-11-19 20:37:39 +01:00
parent ca8b6cac7a
commit daa4ff28e7
2 changed files with 32 additions and 0 deletions

View File

@@ -60,6 +60,12 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
}
});
scope.$on("appState.sectionState.changed", function (e, args) {
if (args.key === "currentSection") {
scope.currentSection = args.value;
}
});
//on page resize
window.onresize = calculateHeight;

View File

@@ -5,6 +5,32 @@
*
* @description
* Tracks the various application state variables when working in the back office, raises events when state changes.
*
* ##Samples
*
* ####Subscribe to global state changes:
*
* <pre>
* scope.showTree = appState.getGlobalState("showNavigation");
*
* scope.$on("appState.globalState.changed", function (e, args) {
* if (args.key === "showNavigation") {
* scope.showTree = args.value;
* }
* });
* </pre>
*
* ####Subscribe to section-state changes
*
* <pre>
* scope.currentSection = appState.getSectionState("currentSection");
*
* scope.$on("appState.sectionState.changed", function (e, args) {
* if (args.key === "currentSection") {
* scope.currentSection = args.value;
* }
* });
* </pre>
*/
function appState($rootScope) {