diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2017-04-08 19:03:53 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2017-04-08 19:03:53 +0300 |
commit | fa5125be25c3e63c83e30a0a2c6766ab2a9a5ae6 (patch) | |
tree | 1015094cc7443742a399c419920f61c8e83c6ad4 /interface/js | |
parent | ed963d568f42db5ada19b0f2777ace8f301a563d (diff) | |
download | rspamd-fa5125be25c3e63c83e30a0a2c6766ab2a9a5ae6.tar.gz rspamd-fa5125be25c3e63c83e30a0a2c6766ab2a9a5ae6.zip |
[WebUI] Display multiple alerts at once
Now user have a chance to see all thrown alerts not just the latest one.
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 |