From edefbce8a73432ada280ccdb28c82a375d62e30a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Z=C3=A1zrivec?= Date: Wed, 1 Nov 2017 10:00:36 +0100 Subject: [PATCH] Merge pull request #2580 from skateman/flash-dismiss Add a dismiss button for dynamically generated flash messages (cherry picked from commit e70d18703fe0713671976fd7403535548110988a) https://bugzilla.redhat.com/show_bug.cgi?id=1509361 --- app/assets/javascripts/miq_flash.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/miq_flash.js b/app/assets/javascripts/miq_flash.js index f421afc7d38..e2e35e9afa7 100644 --- a/app/assets/javascripts/miq_flash.js +++ b/app/assets/javascripts/miq_flash.js @@ -32,14 +32,11 @@ function add_flash(msg, level, options) { var textStrong = $(''); textStrong.text(msg); - var alertDiv = $('
'); + var alertDiv = $('
'); alertDiv.append(iconSpan, textStrong); var textDiv = $('
'); - textDiv.attr('title', __('Click to remove message')); - textDiv.on('click', function() { - textDiv.remove(); - }); + textDiv.append(alertDiv); // if options.id is provided, only one flash message with that id may exist