mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-25 08:21:05 -06:00
webui: use propert alerts in header notification area
Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
parent
bedd128de0
commit
bc6105b270
@ -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;
|
||||
}
|
||||
|
@ -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 = $('<div/>', {
|
||||
'class': 'notification-area',
|
||||
@ -1174,25 +1172,14 @@ IPA.notify = function(message, type, timeout) {
|
||||
notification_area.fadeOut(100);
|
||||
}
|
||||
});
|
||||
message_el = $('<div/>', {
|
||||
'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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user