diff --git a/legacy/app/common/notifications/slider.service.js b/legacy/app/common/notifications/slider.service.js index ba880fb9b6..12fde80b9a 100644 --- a/legacy/app/common/notifications/slider.service.js +++ b/legacy/app/common/notifications/slider.service.js @@ -17,6 +17,8 @@ function SliderService($rootScope, $q, $templateRequest) { deferredOpen.promise.then(function () { $rootScope.$emit('slider:open', template, icon, iconClass, scope, closeOnTimeout, showCloseButton, closeOnNavigate, loading, type); }); + + closeOnNavigation(); } function close() { @@ -40,4 +42,12 @@ function SliderService($rootScope, $q, $templateRequest) { } deferredClose.resolve(); } + + function closeOnNavigation() { + let sliderClose = () => { + close(); + window.removeEventListener('popstate', sliderClose, false); + } + window.addEventListener('popstate', sliderClose, false); + } }