From 482fdbca27e406117fe786d98112c980342c4c4f Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Wed, 6 Sep 2017 10:43:21 +0200 Subject: [PATCH] fixed flash messages with Maximilian --- app/views/application/_flash.html.slim | 4 ++-- lib/assets/javascripts/flash.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/application/_flash.html.slim b/app/views/application/_flash.html.slim index cbb88634..135adcf4 100644 --- a/app/views/application/_flash.html.slim +++ b/app/views/application/_flash.html.slim @@ -1,5 +1,5 @@ #flash.fixed_error_messages data-message-failure=t('shared.message_failure') - %w[alert danger info notice success warning].each do |severity| - div.alert.flash class="alert-#{{'alert' => 'warning', 'notice' => 'success'}.fetch(severity, severity)}" id="flash-#{severity}" - p = flash[severity] + div.alert.flash class="alert-#{{'alert' => 'warning', 'notice' => 'success'}.fetch(severity, severity)}" + p id="flash-#{severity}" = flash[severity] span.fa.fa-times \ No newline at end of file diff --git a/lib/assets/javascripts/flash.js b/lib/assets/javascripts/flash.js index fa79e71d..7f53f2bb 100644 --- a/lib/assets/javascripts/flash.js +++ b/lib/assets/javascripts/flash.js @@ -25,8 +25,8 @@ var showFlashes = function() { $('.flash').each(function() { var container = $(this); - var message = container.children().first(); - var button = container.children().last(); + var message = container.find('p'); + var button = container.find('span.fa-times'); var hide = function() { container.slideUp(function () {