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,8 +162,10 @@
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) {
result = true; if (!!comments.val()) {
dialog.dialog("close"); result = true;
dialog.dialog("close");
}
} }
}); });
@@ -174,8 +176,15 @@
autoOpen: true, autoOpen: true,
buttons: { buttons: {
"Upload": function () { "Upload": function () {
result = true; if (!!comments.val()) {
dialog.dialog("close"); result = true;
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");