Fixes up editorState - ensures that it is set in all of the correct places (removes appState editingEntity and references), ensures that setting 'current' is not possible, ensures that editorState is reset on all route changes, adds unit tests for getting/setting editorState.

This commit is contained in:
Shannon
2013-11-19 10:39:18 +11:00
parent 89b20a2e77
commit 5bb68f32bf
8 changed files with 81 additions and 46 deletions

View File

@@ -1,6 +1,6 @@
/** Executed when the application starts */
app.run(['userService', '$log', '$rootScope', '$location', 'navigationService', 'appState',
function(userService, $log, $rootScope, $location, navigationService, appState) {
app.run(['userService', '$log', '$rootScope', '$location', 'navigationService', 'appState', 'editorState',
function(userService, $log, $rootScope, $location, navigationService, appState, editorState) {
var firstRun = true;
@@ -18,10 +18,14 @@ app.run(['userService', '$log', '$rootScope', '$location', 'navigationService',
if(current.params.section){
$rootScope.locationTitle = current.params.section + " - " + $location.$$host;
}else{
}
else {
$rootScope.locationTitle = "Umbraco - " + $location.$$host;
}
//reset the editorState on each successful route chage
editorState.reset();
});
/** When the route change is rejected - based on checkAuth - we'll prevent the rejected route from executing including