PHRAS-1010 - fix maintenance message display

This commit is contained in:
Florian BLOUET
2016-02-26 11:45:30 +01:00
parent db47b7621d
commit fdc2129c22
3 changed files with 17 additions and 5 deletions

View File

@@ -384,7 +384,7 @@ function manageSession(data, showMessages) {
$('body').append('<div id="#MESSAGE"></div>');
$('#MESSAGE')
.empty()
.append(data.message + '<div style="margin:20px;"><input type="checkbox" class="dialog_remove" />' + language.hideMessage + '</div>')
.append('<div style="margin:30px 10px;"><h4><b>' + data.message + '</b></h4></div><div style="margin:20px 0px 10px;"><label class="checkbox"><input type="checkbox" class="dialog_remove" />' + language.hideMessage + '</label></div>')
.attr('title', 'Global Message')
.dialog({
autoOpen: false,
@@ -393,8 +393,20 @@ function manageSession(data, showMessages) {
draggable: false,
modal: true,
close: function () {
if ($('.dialog_remove:checked', $(this)).length > 0)
setTemporaryPref('message', 0);
if ($('.dialog_remove:checked', $(this)).length > 0) {
// setTemporaryPref
$.ajax({
type: "POST",
url: "/user/preferences/temporary/",
data: {
prop: 'message',
value: 0
},
success: function (data) {
return;
}
});
}
}
})
.dialog('open');