Hi,
I think the success messages are stacking on the screen more than the error messages and
that's why this issue was opened. A workaround to prevent the modal windows from
increasing as the messages (error, warning and success) start to stack is that we check if
there isn't a closable alert on the screen with the same text. If it does, then we
remove the first instance and display the new one. The drawback is that the user will only
notice that something happened when there's a collection of other different alerts and
a new one pops on the alert container.
Samuel
-----Original Message-----
From: kimchi-devel-bounces(a)ovirt.org [mailto:kimchi-devel-bounces@ovirt.org] On Behalf Of
Daniel Henrique Barboza
Sent: sexta-feira, 12 de agosto de 2016 15:17
To: kimchi-devel(a)ovirt.org
Subject: Re: [Kimchi-devel] [PATCH ][Wok] Issue # 156 : Wok success message is not
disappearing automatically.
As I said in the Github issue, this is not a bug. This was an accessibility change Samuel
did. The messages must stay visible until the user dismisses it.
On 08/12/2016 06:04 AM, atreyee(a)linux.vnet.ibm.com wrote:
From: Atreyee Mukhopadhyay <atreyee(a)linux.vnet.ibm.com>
Making closable parameter configurable for Success, error,warn and
notify method instead of making it default true.
---
ui/js/src/wok.message.js | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/ui/js/src/wok.message.js b/ui/js/src/wok.message.js index
159dc36..1c07466 100644
--- a/ui/js/src/wok.message.js
+++ b/ui/js/src/wok.message.js
@@ -20,14 +20,13 @@
wok.message = function(msg, level, node, closeable, onclick, alertId) {
"use strict";
- var close = closeable || true;
var container = node || $('#alert-fields');
if($("#" + alertId).length === 0) {
if ($(container).size() < 1) {
container = $('<div
id="alert-fields"/>').appendTo($('#alert-container'));
}
var message = '<div '+( alertId ?
'id="'+alertId+'"' : '')+' role="alert"
class="alert ' + (level || '') + ' '+( close ?
'alert-dismissible' : '')+' fade in" style="display:
none;">';
- if(!node || close) {
+ if(!node || closeable) {
message += '<button type="button" class="close"
data-dismiss="alert" aria-label="Close" onclick="' + (onclick
|| '') + '"><span aria-hidden="true"><i
class="fa fa-times-circle"></i></span></button>';
}
message += msg;
@@ -38,7 +37,7 @@ wok.message = function(msg, level, node, closeable, onclick, alertId)
{
$message.alert();
$message.fadeIn(100);
- if(!close){
+ if(!closeable){
var timeout = setTimeout(function() {
$message.delay(4000).fadeOut(100, function() {
$message.alert('close'); @@ -54,22 +53,27 @@
wok.message = function(msg, level, node, closeable, onclick, alertId)
{
wok.message.warn = function(msg, node, closeable, alertId) {
"use strict";
+ closeable = closeable || true;
wok.message(msg, 'alert-warning', node, closeable, null, alertId);
};
wok.message.error = function(msg, node, closeable, alertId) {
"use strict";
+ closeable = closeable || true;
wok.message(msg, 'alert-danger', node, closeable, null, alertId);
};
wok.message.error.code = function(code, node, closeable, alertId) {
"use strict";
var msg = code + ": " + i18n[code];
+ closeable = closeable || true;
wok.message(msg, 'alert-danger', node, closeable, null, alertId);
};
wok.message.success = function(msg, node, closeable, alertId) {
"use strict";
+ closeable = closeable || false;
wok.message(msg, 'alert-success', node, closeable, null, alertId);
};
wok.message.notify = function(notification, node) {
"use strict";
+ closeable = closeable || true;
wok.message(notification.message, 'alert-warning', node, true,
"wok.removeNotification('" + notification.code + "')");
};
_______________________________________________
Kimchi-devel mailing list
Kimchi-devel(a)ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel