prevent joyride in error pages
parent
0017193cd6
commit
382013751e
|
@ -430,7 +430,7 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven
|
|||
# Add next param when user try to access to a secction need auth permissions.
|
||||
authHttpIntercept = ($q, $location, $navUrls, $lightboxService) ->
|
||||
httpResponseError = (response) ->
|
||||
if response.status == 0
|
||||
if response.status == 0 || response.status == -1
|
||||
$lightboxService.closeAll()
|
||||
$location.path($navUrls.resolve("error"))
|
||||
$location.replace()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
taiga = @.taiga
|
||||
|
||||
JoyRideDirective = ($rootScope, currentUserService, joyRideService) ->
|
||||
JoyRideDirective = ($rootScope, currentUserService, joyRideService, $location) ->
|
||||
link = (scope, el, attrs, ctrl) ->
|
||||
intro = introJs()
|
||||
|
||||
|
@ -30,7 +30,9 @@ JoyRideDirective = ($rootScope, currentUserService, joyRideService) ->
|
|||
intro.start()
|
||||
|
||||
$rootScope.$on '$routeChangeSuccess', (event, next) ->
|
||||
return if !next.joyride || !currentUserService.isAuthenticated()
|
||||
return if !next.joyride ||
|
||||
!currentUserService.isAuthenticated() ||
|
||||
$location.path() == '/error'
|
||||
|
||||
intro.oncomplete () ->
|
||||
currentUserService.disableJoyRide(next.joyride)
|
||||
|
@ -53,7 +55,8 @@ JoyRideDirective = ($rootScope, currentUserService, joyRideService) ->
|
|||
JoyRideDirective.$inject = [
|
||||
"$rootScope",
|
||||
"tgCurrentUserService",
|
||||
"tgJoyRideService"
|
||||
"tgJoyRideService",
|
||||
"$location"
|
||||
]
|
||||
|
||||
angular.module("taigaComponents").directive("tgJoyRide", JoyRideDirective)
|
||||
|
|
Loading…
Reference in New Issue