diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-09 11:07:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-09 11:07:02 +0100 |
commit | d49b91da3fbf65285a6f0302e5fc625638f9fddd (patch) | |
tree | 445f0fb166d580839a0b04bbb88704bbf45797e0 /interface/js | |
parent | 2ed1aa136fd36e7975ea151ee9e3affbcaa5cf59 (diff) | |
parent | fa5125be25c3e63c83e30a0a2c6766ab2a9a5ae6 (diff) | |
download | rspamd-d49b91da3fbf65285a6f0302e5fc625638f9fddd.tar.gz rspamd-d49b91da3fbf65285a6f0302e5fc625638f9fddd.zip |
Merge pull request #1584 from moisseev/webui
[WebUI] Display multiple alerts at once
Diffstat (limited to 'interface/js')
-rw-r--r-- | interface/js/app/rspamd.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/interface/js/app/rspamd.js b/interface/js/app/rspamd.js index dbd4c33b9..dc58f53bd 100644 --- a/interface/js/app/rspamd.js +++ b/interface/js/app/rspamd.js @@ -164,18 +164,17 @@ define(['jquery', 'd3pie', 'visibility', 'app/stats', 'app/graph', 'app/config', $('#progress').hide(); } - function alertMessage (alertState, alertText) { - if ($('.alert').is(':visible')) { - $(alert).hide().remove(); - } - var alert = $('<div class="alert ' + alertState + '" style="display:none">' + - '<button type="button" class="close" data-dismiss="alert" tutle="Dismiss">×</button>' + - '<strong>' + alertText + '</strong>') - .prependTo('body'); - $(alert).show(); + function alertMessage(alertClass, alertText) { + const a = $('<div class="alert ' + alertClass + ' alert-dismissible fade in show">' + + '<button type="button" class="close" data-dismiss="alert" title="Dismiss">×</button>' + + '<strong>' + alertText + '</strong>'); + $('.notification-area').append(a); + setTimeout(function () { - $(alert).remove(); - }, 3600); + $(a).fadeTo(500, 0).slideUp(500, function () { + $(this).alert('close'); + }); + }, 5000); } // Public functions |