Skip to content

Commit

Permalink
Merge pull request #1964 from nebulab/improve-styleguide-flashes
Browse files Browse the repository at this point in the history
Improve style guide flash messages UX
  • Loading branch information
kennyadsl authored Jun 12, 2017
2 parents aa21865 + e915848 commit 153332b
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
<script>
$('.trigger-flash').on('click', function(){
type = $(this).data('flashType');
flash = $("<div class='flash'>")
.text(type)
.addClass(type)
.appendTo('.js-flash-wrapper');

if (!$('.flash.' + type).is('*')) {
flash = $("<div class='flash'>")
.text(type)
.addClass(type)
.appendTo('.js-flash-wrapper')
.on('click', function() {
$(this).remove();
});
}
});
</script>

0 comments on commit 153332b

Please sign in to comment.