fix joy-ride in error pages
parent
a757618d97
commit
b4b0334dbe
|
@ -2,6 +2,7 @@ taiga = @.taiga
|
|||
|
||||
JoyRideDirective = ($rootScope, currentUserService, joyRideService, $location) ->
|
||||
link = (scope, el, attrs, ctrl) ->
|
||||
unsuscribe = null
|
||||
intro = introJs()
|
||||
|
||||
#Todo: translate
|
||||
|
@ -30,19 +31,21 @@ JoyRideDirective = ($rootScope, currentUserService, joyRideService, $location) -
|
|||
intro.start()
|
||||
|
||||
$rootScope.$on '$routeChangeSuccess', (event, next) ->
|
||||
return if !next.joyride ||
|
||||
!currentUserService.isAuthenticated() ||
|
||||
$location.path() == '/error'
|
||||
if !next.joyride || !currentUserService.isAuthenticated()
|
||||
intro.exit()
|
||||
unsuscribe() if unsuscribe
|
||||
return
|
||||
|
||||
|
||||
intro.oncomplete () ->
|
||||
currentUserService.disableJoyRide(next.joyride)
|
||||
|
||||
if next.loader
|
||||
un = $rootScope.$on 'loader:end', () ->
|
||||
unsuscribe = $rootScope.$on 'loader:end', () ->
|
||||
currentUserService.loadJoyRideConfig()
|
||||
.then (config) -> initJoyrRide(next, config)
|
||||
|
||||
un()
|
||||
unsuscribe()
|
||||
else
|
||||
currentUserService.loadJoyRideConfig()
|
||||
.then (config) -> initJoyrRide(next, config)
|
||||
|
|
Loading…
Reference in New Issue