From 6e66224fed28f2ded9b5b460f104c3363f44132f Mon Sep 17 00:00:00 2001 From: Hagen Schink Date: Fri, 4 Apr 2014 08:47:56 +0200 Subject: [PATCH] Fix flash message activation --- app/assets/javascripts/application.js.erb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index fcc18717d0..2fe46f8a0f 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -1248,15 +1248,16 @@ var activateError = function() { } var activateFlash = function() { - var flashMessage = jQuery('.flash'); + var flashMessages = jQuery('.flash'); // Ignore flash messages of class 'ignored-by-flash-activation' because those // messages are completely handled via JavaScript (see types_checkboxes.js for // details). We wouldn't have to ignore this message if the flash element // would be completely created via JavaScript and not available in the DOM by // default. - flashMessage.each(function (ix, e) { - if (!jQuery(e).hasClass('ignored-by-flash-activation')) { + flashMessages.each(function (ix, e) { + flashMessage = jQuery(e); + if (!flashMessage.hasClass('ignored-by-flash-activation')) { flashMessage.show(); } });