1
1
angular . module ( "umbraco" ) . controller ( "Analytics.SettingsController" ,
2
- function ( $scope , settingsResource , notificationsService , localizationService , navigationService ) {
2
+ function ( $scope , $routeParams , settingsResource , notificationsService , localizationService , navigationService ) {
3
3
4
4
//By default user has not authorised
5
5
var hasUserAuthd = false ;
43
43
44
44
//Only load/fetch if showAuth is true
45
45
if ( hasUserAuthd === true ) {
46
-
47
- console . log ( "get accounts" ) ;
46
+
48
47
//Get all accounts via settingsResource - does WebAPI GET call
49
48
settingsResource . getaccounts ( ) . then ( function ( response ) {
50
49
$scope . accounts = response . data ;
64
63
65
64
//When an account is selected
66
65
$scope . accountSelected = function ( selectedAccount ) {
67
- console . log ( selectedAccount ) ;
68
-
69
66
settingsResource . getprofiles ( selectedAccount . Id ) . then ( function ( response ) {
70
67
$scope . profiles = response . data ;
71
68
} ) ;
109
106
notificationsService . success ( localizationService . localize ( "analytics_profileDetailsSaved" ) ) ;
110
107
111
108
//Sync ('refresh') the tree!
112
- navigationService . syncTree ( { tree : 'analyticsTree' , path : [ - 1 , - 1 ] , forceReload : true , activate : true } ) ;
109
+ navigationService . syncTree ( { tree : 'analyticsTree' , path : [ - 1 , $routeParams . id ] , forceReload : true , activate : true } ) ;
113
110
} ) ;
114
111
115
112
} ;
116
113
114
+ navigationService . syncTree ( { tree : 'analyticsTree' , path : [ "-1" , $routeParams . id ] , forceReload : false } ) ;
117
115
} ) ;
0 commit comments