prevent loader in the issues filter

stable
Juanfran 2015-06-18 09:20:18 +02:00
parent b5fbaa402d
commit b5b827a363
2 changed files with 18 additions and 6 deletions

View File

@ -559,11 +559,20 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na
# Analytics
$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
loaderService.startWithAutoClose()
loaderService.start(true)
un()
$rootscope.$on '$routeChangeSuccess', (event, next) ->
if next.loader
loaderService.start(true)
if next.access && next.access.requiresLogin
if !$auth.isAuthenticated()
$location.path($navUrls.resolve("login"))

View File

@ -51,6 +51,7 @@ Loader = ($rootscope) ->
minTime: 300
}
open = false
startLoadTime = 0
requestCount = 0
lastResponseDate = 0
@ -68,6 +69,7 @@ Loader = ($rootscope) ->
timeout timeoutValue, ->
$rootscope.$broadcast("loader:end")
open = false
window.prerenderReady = true # Needed by Prerender Server
startLoadTime = 0
@ -93,13 +95,14 @@ Loader = ($rootscope) ->
start = () ->
startLoadTime = new Date().getTime()
$rootscope.$broadcast("loader:start")
open = true
return {
pageLoaded: pageLoaded
start: start
startWithAutoClose: () ->
start()
autoClose()
start: (auto=false) ->
if !open
start()
autoClose() if auto
onStart: (fn) ->
$rootscope.$on("loader:start", fn)