Prevent fading out flash messages if accessibility mode is enabled

pull/1401/head
Till Breuer 11 years ago
parent 4c811523c6
commit e3f1f85ae2
  1. 5
      app/assets/javascripts/angular/directives/components/flash-message-directive.js
  2. 7
      app/assets/javascripts/angular/openproject-app.js

@ -32,7 +32,8 @@ angular.module('openproject.uiComponents')
.directive('flashMessage', [ .directive('flashMessage', [
'$rootScope', '$rootScope',
'$timeout', '$timeout',
function($rootScope, $timeout) { 'ConfigurationService',
function($rootScope, $timeout, ConfigurationService) {
return { return {
restrict: 'E', restrict: 'E',
@ -53,9 +54,11 @@ angular.module('openproject.uiComponents')
} }
// fade out after time out // fade out after time out
if (!ConfigurationService.accessibilityModeEnabled()) {
$timeout(function() { $timeout(function() {
scope.message = undefined; scope.message = undefined;
}, fadeOutTime); }, fadeOutTime);
}
}); });
} }
}; };

@ -136,6 +136,11 @@ openprojectApp
}; };
}); });
}]) }])
.run(['$http', function($http){ .run([
'$http',
'ConfigurationService',
function($http, ConfigurationService){
$http.defaults.headers.common.Accept = 'application/json'; $http.defaults.headers.common.Accept = 'application/json';
ConfigurationService.addConfiguration('accessibilityMode', OpenProject.Helpers.accessibilityModeEnabled());
}]); }]);

Loading…
Cancel
Save