@@ -21,18 +21,16 @@ angular.module('zeppelinWebApp')
2121 var vm = this ;
2222 vm . arrayOrderingSrv = arrayOrderingSrv ;
2323 vm . connected = websocketMsgSrv . isConnected ( ) ;
24+ vm . isActive = isActive ;
25+ vm . logout = logout ;
2426 vm . notes = notebookListDataFactory ;
27+ vm . search = search ;
2528 vm . searchForm = searchService ;
26- vm . websocketMsgSrv = websocketMsgSrv ;
29+ vm . showLoginWindow = showLoginWindow ;
2730
2831 $scope . query = { q : '' } ;
29- /** Current list of notes (ids) */
3032
31- angular . element ( '#notebook-list' ) . perfectScrollbar ( { suppressScrollX : true } ) ;
32-
33- angular . element ( document ) . click ( function ( ) {
34- $scope . query . q = '' ;
35- } ) ;
33+ initController ( ) ;
3634
3735 function getZeppelinVersion ( ) {
3836 $http . get ( baseUrlSrv . getRestApiBase ( ) + '/version' ) . success (
@@ -44,6 +42,17 @@ angular.module('zeppelinWebApp')
4442 } ) ;
4543 }
4644
45+ function initController ( ) {
46+ angular . element ( '#notebook-list' ) . perfectScrollbar ( { suppressScrollX : true } ) ;
47+
48+ angular . element ( document ) . click ( function ( ) {
49+ $scope . query . q = '' ;
50+ } ) ;
51+
52+ getZeppelinVersion ( ) ;
53+ loadNotes ( ) ;
54+ }
55+
4756 function isActive ( noteId ) {
4857 return ( $routeParams . noteId === noteId ) ;
4958 }
@@ -84,21 +93,6 @@ angular.module('zeppelinWebApp')
8493 } , 500 ) ;
8594 }
8695
87- $rootScope . noteName = function ( note ) {
88- if ( ! _ . isEmpty ( note ) ) {
89- return arrayOrderingSrv . getNoteName ( note ) ;
90- }
91- } ;
92-
93- vm . loadNotes = loadNotes ;
94- vm . isActive = isActive ;
95- vm . logout = logout ;
96- vm . search = search ;
97- vm . showLoginWindow = showLoginWindow ;
98-
99- getZeppelinVersion ( ) ;
100- vm . loadNotes ( ) ;
101-
10296 /*
10397 ** $scope.$on functions below
10498 */
@@ -112,7 +106,7 @@ angular.module('zeppelinWebApp')
112106 } ) ;
113107
114108 $scope . $on ( 'loginSuccess' , function ( event , param ) {
115- vm . loadNotes ( ) ;
109+ loadNotes ( ) ;
116110 } ) ;
117111
118112} ) ;
0 commit comments