close lightbox if the user press the browswer back button
parent
4d76356024
commit
56327838cd
|
@ -690,7 +690,7 @@ i18nInit = (lang, $translate) ->
|
||||||
|
|
||||||
|
|
||||||
init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, appMetaService,
|
init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, appMetaService,
|
||||||
loaderService, navigationBarService, errorHandlingService) ->
|
loaderService, navigationBarService, errorHandlingService, lightboxService) ->
|
||||||
$log.debug("Initialize application")
|
$log.debug("Initialize application")
|
||||||
|
|
||||||
$rootscope.$on '$translatePartialLoaderStructureChanged', () ->
|
$rootscope.$on '$translatePartialLoaderStructureChanged', () ->
|
||||||
|
@ -737,6 +737,11 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na
|
||||||
$rootscope.$on '$locationChangeStart', (event) ->
|
$rootscope.$on '$locationChangeStart', (event) ->
|
||||||
errorHandlingService.init()
|
errorHandlingService.init()
|
||||||
|
|
||||||
|
if lightboxService.getLightboxOpen().length
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
lightboxService.closeAll()
|
||||||
|
|
||||||
# On the first page load the loader is painted in `$routeChangeSuccess`
|
# On the first page load the loader is painted in `$routeChangeSuccess`
|
||||||
# because we need to hide the tg-navigation-bar.
|
# because we need to hide the tg-navigation-bar.
|
||||||
# In the other cases the loader is in `$routeChangeSuccess`
|
# In the other cases the loader is in `$routeChangeSuccess`
|
||||||
|
@ -861,5 +866,6 @@ module.run([
|
||||||
"tgLoader",
|
"tgLoader",
|
||||||
"tgNavigationBarService",
|
"tgNavigationBarService",
|
||||||
"tgErrorHandlingService",
|
"tgErrorHandlingService",
|
||||||
|
"lightboxService",
|
||||||
init
|
init
|
||||||
])
|
])
|
||||||
|
|
|
@ -97,6 +97,10 @@ class LightboxService extends taiga.Service
|
||||||
scope.$destroy() if scope
|
scope.$destroy() if scope
|
||||||
$el.remove()
|
$el.remove()
|
||||||
|
|
||||||
|
|
||||||
|
getLightboxOpen: ->
|
||||||
|
return $(".lightbox.open")
|
||||||
|
|
||||||
closeAll: ->
|
closeAll: ->
|
||||||
docEl = angular.element(document)
|
docEl = angular.element(document)
|
||||||
for lightboxEl in docEl.find(".lightbox.open")
|
for lightboxEl in docEl.find(".lightbox.open")
|
||||||
|
|
Loading…
Reference in New Issue