Skip to content

Commit

Permalink
Merge pull request #2580 from skateman/flash-dismiss
Browse files Browse the repository at this point in the history
Add a dismiss button for dynamically generated flash messages
(cherry picked from commit e70d187)

https://bugzilla.redhat.com/show_bug.cgi?id=1509361
  • Loading branch information
mzazrivec authored and simaishi committed Nov 6, 2017
1 parent ff82fd5 commit edefbce
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/assets/javascripts/miq_flash.js
Expand Up @@ -32,14 +32,11 @@ function add_flash(msg, level, options) {
var textStrong = $('<strong></strong>');
textStrong.text(msg);

var alertDiv = $('<div class="' + cls.alert + '"></div>');
var alertDiv = $('<div class="' + cls.alert + '"><button class="close" data-dismiss="alert"><span class="pficon pficon-close"></span></button></div>');
alertDiv.append(iconSpan, textStrong);

var textDiv = $('<div class="flash_text_div"></div>');
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
Expand Down

0 comments on commit edefbce

Please sign in to comment.