reset mailadress/displayname on blur

This commit is contained in:
michag86 2015-12-07 09:48:54 +01:00
parent 884946276e
commit cf0d163a32
1 changed files with 5 additions and 3 deletions

View File

@ -694,6 +694,8 @@ $(document).ready(function () {
}
}
);
var displayName = $input.val();
$tr.data('displayname', displayName);
$input.blur();
} else {
$input.blur();
@ -701,8 +703,7 @@ $(document).ready(function () {
}
})
.blur(function () {
var displayName = $input.val();
$tr.data('displayname', displayName);
var displayName = $tr.data('displayname');
$input.replaceWith('<span>' + escapeHTML(displayName) + '</span>');
$td.find('img').show();
});
@ -721,6 +722,7 @@ $(document).ready(function () {
.keypress(function (event) {
if (event.keyCode === 13) {
if ($(this).val().length > 0) {
$tr.data('mailAddress', $input.val());
$input.blur();
$.ajax({
type: 'PUT',
@ -740,7 +742,7 @@ $(document).ready(function () {
}
})
.blur(function () {
var mailAddress = $input.val();
var mailAddress = $tr.data('mailAddress');
var $span = $('<span>').text(mailAddress);
$tr.data('mailAddress', mailAddress);
$input.replaceWith($span);