prevent loader in the issues filter
parent
b5fbaa402d
commit
b5b827a363
|
@ -559,11 +559,20 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na
|
||||||
# Analytics
|
# Analytics
|
||||||
$analytics.initialize()
|
$analytics.initialize()
|
||||||
|
|
||||||
$rootscope.$on '$routeChangeStart', (event, next) ->
|
# On the first page load the loader is painted in `$routeChangeSuccess`
|
||||||
|
# because we need to hide the tg-navigation-bar.
|
||||||
|
# In the other cases the loader is in `$routeChangeSuccess`
|
||||||
|
# because `location.noreload` prevent to execute this event.
|
||||||
|
un = $rootscope.$on '$routeChangeStart', (event, next) ->
|
||||||
if next.loader
|
if next.loader
|
||||||
loaderService.startWithAutoClose()
|
loaderService.start(true)
|
||||||
|
|
||||||
|
un()
|
||||||
|
|
||||||
$rootscope.$on '$routeChangeSuccess', (event, next) ->
|
$rootscope.$on '$routeChangeSuccess', (event, next) ->
|
||||||
|
if next.loader
|
||||||
|
loaderService.start(true)
|
||||||
|
|
||||||
if next.access && next.access.requiresLogin
|
if next.access && next.access.requiresLogin
|
||||||
if !$auth.isAuthenticated()
|
if !$auth.isAuthenticated()
|
||||||
$location.path($navUrls.resolve("login"))
|
$location.path($navUrls.resolve("login"))
|
||||||
|
|
|
@ -51,6 +51,7 @@ Loader = ($rootscope) ->
|
||||||
minTime: 300
|
minTime: 300
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open = false
|
||||||
startLoadTime = 0
|
startLoadTime = 0
|
||||||
requestCount = 0
|
requestCount = 0
|
||||||
lastResponseDate = 0
|
lastResponseDate = 0
|
||||||
|
@ -68,6 +69,7 @@ Loader = ($rootscope) ->
|
||||||
|
|
||||||
timeout timeoutValue, ->
|
timeout timeoutValue, ->
|
||||||
$rootscope.$broadcast("loader:end")
|
$rootscope.$broadcast("loader:end")
|
||||||
|
open = false
|
||||||
window.prerenderReady = true # Needed by Prerender Server
|
window.prerenderReady = true # Needed by Prerender Server
|
||||||
|
|
||||||
startLoadTime = 0
|
startLoadTime = 0
|
||||||
|
@ -93,13 +95,14 @@ Loader = ($rootscope) ->
|
||||||
start = () ->
|
start = () ->
|
||||||
startLoadTime = new Date().getTime()
|
startLoadTime = new Date().getTime()
|
||||||
$rootscope.$broadcast("loader:start")
|
$rootscope.$broadcast("loader:start")
|
||||||
|
open = true
|
||||||
|
|
||||||
return {
|
return {
|
||||||
pageLoaded: pageLoaded
|
pageLoaded: pageLoaded
|
||||||
start: start
|
start: (auto=false) ->
|
||||||
startWithAutoClose: () ->
|
if !open
|
||||||
start()
|
start()
|
||||||
autoClose()
|
autoClose() if auto
|
||||||
onStart: (fn) ->
|
onStart: (fn) ->
|
||||||
$rootscope.$on("loader:start", fn)
|
$rootscope.$on("loader:start", fn)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue