summaryrefslogtreecommitdiffstats
path: root/interface/js
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-04-09 11:07:02 +0100
committerGitHub <noreply@github.com>2017-04-09 11:07:02 +0100
commitd49b91da3fbf65285a6f0302e5fc625638f9fddd (patch)
tree445f0fb166d580839a0b04bbb88704bbf45797e0 /interface/js
parent2ed1aa136fd36e7975ea151ee9e3affbcaa5cf59 (diff)
parentfa5125be25c3e63c83e30a0a2c6766ab2a9a5ae6 (diff)
downloadrspamd-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.js21
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">&times;</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">&times;</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