Bug Fix #80 - Prompt for attachment comment

This commit is contained in:
Gary Sharp
2016-09-29 18:32:52 +10:00
parent 3c521541fd
commit 5fcb81e9e8
@@ -162,9 +162,11 @@
var comments = dialog.find('input.comments') var comments = dialog.find('input.comments')
.keypress(function (e) { .keypress(function (e) {
if (e.which === 13) { if (e.which === 13) {
if (!!comments.val()) {
result = true; result = true;
dialog.dialog("close"); dialog.dialog("close");
} }
}
}); });
dialog.dialog({ dialog.dialog({
@@ -174,8 +176,15 @@
autoOpen: true, autoOpen: true,
buttons: { buttons: {
"Upload": function () { "Upload": function () {
if (!!comments.val()) {
result = true; result = true;
dialog.dialog("close"); dialog.dialog("close");
window.setTimeout(function () {
comments.focus();
}, 1);
} else {
alert('Please provide a comment for this attachment.');
}
}, },
Cancel: function () { Cancel: function () {
dialog.dialog("close"); dialog.dialog("close");