Commit a7802a74 authored by Michal Čihař's avatar Michal Čihař

Better handling of zen saving

- hide response icon when loading
- do not show empty tooltip
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 4da9d3ea
......@@ -182,14 +182,15 @@ function zen_editor(e) {
$row.addClass('translation-modified');
var form = $row.find('form');
$('#loading-' + checksum).show();
var statusdiv = $('#status-' + checksum).hide();
var loadingdiv = $('#loading-' + checksum).show();
$.post(
form.attr('action'),
form.serialize(),
function (data) {
var messages = $('<div>' + data + '</div>');
var statusdiv = $('#status-' + checksum);
$('#loading-' + checksum).hide();
loadingdiv.hide();
statusdiv.show();
if (messages.find('.alert-danger').length > 0) {
statusdiv.attr('class', 'glyphicon-remove-sign text-danger');
} else if (messages.find('.alert-warning').length > 0) {
......@@ -199,10 +200,13 @@ function zen_editor(e) {
} else {
statusdiv.attr('class', 'glyphicon-ok-sign text-success');
}
statusdiv.addClass('glyphicon').tooltip({
'html': true,
'title': data
});
statusdiv.addClass('glyphicon').tooltip('destroy');
if (data.trim() !== '') {
statusdiv.tooltip({
'html': true,
'title': data
});
};
$row.removeClass('translation-modified').addClass('translation-saved');
}
);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment