From bc6105b270ad10349d12d144b5f67660e7f734e3 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Wed, 28 May 2014 18:08:13 +0200 Subject: [PATCH] webui: use propert alerts in header notification area Reviewed-By: Endi Sukma Dewata --- install/ui/ipa.css | 4 ---- install/ui/src/freeipa/ipa.js | 21 ++++----------------- install/ui/src/freeipa/widget.js | 2 +- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/install/ui/ipa.css b/install/ui/ipa.css index 5a5262f3e..41f88a763 100644 --- a/install/ui/ipa.css +++ b/install/ui/ipa.css @@ -50,11 +50,7 @@ textarea[readonly] { .notification-area div { position: relative; left: -50%; - - line-height: 1.5em; z-index: 20; - padding: 4px; - text-align: center; word-wrap: break-word; max-width: 500px; } diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js index d74881924..8a1ebaed7 100644 --- a/install/ui/src/freeipa/ipa.js +++ b/install/ui/src/freeipa/ipa.js @@ -1164,8 +1164,6 @@ IPA.notify = function(message, type, timeout) { } var notification_area = $('.notification-area'); - var message_el = $('.notification-area div'); - if (notification_area.length === 0) { notification_area = $('
', { 'class': 'notification-area', @@ -1174,25 +1172,14 @@ IPA.notify = function(message, type, timeout) { notification_area.fadeOut(100); } }); - message_el = $('
', { - 'class': 'alert' - }).appendTo(notification_area); notification_area.appendTo('#container'); } + notification_area.empty(); - if (IPA.notify_success.current_cls) { - message_el.removeClass(IPA.notify_success.current_cls); - IPA.notify_success.current_cls = null; - } - - if (type && type !== 'warning') { - var type_cls = 'alert-'+type; - message_el.addClass(type_cls); - IPA.notify_success.current_cls = type_cls; - } - - message_el.text(message); + var alert = IPA.alert_helper.create_alert('msg', message, type); + var el = IPA.alert_helper.render_alert(alert); + notification_area.append(el); destroy_timeout(); notification_area.fadeIn(IPA.config.message_fadein_time); diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 6c08e1e60..fc60959cd 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -5444,7 +5444,7 @@ IPA.value_map_widget = function(spec) { * @alternateClassName IPA.alert_helper * @singleton */ -exp.alert_helper = { +exp.alert_helper = IPA.alert_helper = { /** * Create alert object