@@ -24,15 +24,21 @@ export class NavbarController implements angular.IController {
2424 displayShareButton : boolean ;
2525 projectTypeNames : ProjectTypeNames ;
2626 siteName : string ;
27+ showShareButton : boolean = false ;
2728
28- static $inject = [ '$uibModal' ,
29- 'projectService' , 'sessionService' ,
29+ static $inject = [
30+ '$scope' ,
31+ '$uibModal' ,
32+ 'projectService' ,
33+ 'sessionService' ,
3034 'offlineCacheUtils' ,
3135 'applicationHeaderService' ] ;
32- constructor ( private readonly $modal : ModalService ,
36+ constructor ( private readonly $scope : angular . IScope ,
37+ private readonly $modal : ModalService ,
3338 private readonly projectService : ProjectService , private readonly sessionService : SessionService ,
3439 private readonly offlineCacheUtils : OfflineCacheUtilsService ,
35- private readonly applicationHeaderService : ApplicationHeaderService ) { }
40+ private readonly applicationHeaderService : ApplicationHeaderService ,
41+ ) { }
3642
3743 $onInit ( ) : void {
3844 this . projectTypeNames = this . projectService . data . projectTypeNames ;
@@ -76,6 +82,15 @@ export class NavbarController implements angular.IController {
7682 session . hasSiteRight ( this . sessionService . domain . PROJECTS , this . sessionService . operation . CREATE ) ;
7783 this . siteName = session . baseSite ( ) ;
7884 } ) ;
85+ this . $scope . $on ( '$locationChangeStart' , ( event , next , current ) => {
86+ if ( current . includes ( '/lexicon' ) && ! current . includes ( '/new-project' ) ) {
87+ console . log ( `Current Path ${ location . pathname } ` ) ;
88+ this . showShareButton = true ;
89+ } else {
90+ this . showShareButton = false ;
91+ }
92+ console . log ( `location pathname: ${ location . pathname } , next: ${ next } , current: ${ current } ` ) ;
93+ } )
7994 }
8095
8196 onUpdate = ( $event : { interfaceConfig : InterfaceConfig } ) : void => {
0 commit comments