diff options
author | Magnus Hagander | 2015-02-15 11:23:51 +0000 |
---|---|---|
committer | Magnus Hagander | 2015-02-15 11:23:51 +0000 |
commit | a5300fa4802749be5d43f3183f636c70342538cc (patch) | |
tree | 828478631264b1d6b55302d920a639f9866589e8 /pgcommitfest/commitfest/static | |
parent | 27cba025a501c9dbcfb08da0c4db95dc6111d647 (diff) |
Add the ability to copy/paste a msgid when creating an annotation
Diffstat (limited to 'pgcommitfest/commitfest/static')
-rw-r--r-- | pgcommitfest/commitfest/static/commitfest/js/commitfest.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/pgcommitfest/commitfest/static/commitfest/js/commitfest.js b/pgcommitfest/commitfest/static/commitfest/js/commitfest.js index 4fd06e5..be143f9 100644 --- a/pgcommitfest/commitfest/static/commitfest/js/commitfest.js +++ b/pgcommitfest/commitfest/static/commitfest/js/commitfest.js @@ -126,6 +126,7 @@ function updateAnnotationMessages(threadid) { }).success(function(data) { sel = $('#annotateMessageList') sel.find('option').remove(); + sel.append('<option value="">---</option>'); $.each(data, function(i,m) { sel.append('<option value="' + m.msgid + '">' + m.from + ': ' + m.subj + ' (' + m.date + ')</option>'); }); @@ -136,7 +137,9 @@ function updateAnnotationMessages(threadid) { function addAnnotation(threadid) { $('#annotateThreadList').find('option').remove(); $('#annotateMessage').val(''); + $('#annotateMsgId').val(''); $('#annotateModal').modal(); + $('#annotateThreadList').focus(); updateAnnotationMessages(threadid); $('#doAnnotateMessageButton').unbind('click'); $('#doAnnotateMessageButton').click(function() { @@ -144,11 +147,12 @@ function addAnnotation(threadid) { $('#annotateMessageBody').addClass('loading'); $.post('/ajax/annotateMessage/', { 't': threadid, - 'msgid': $('#annotateMessageList').val(), + 'msgid': $.trim($('#annotateMsgId').val()), 'msg': $('#annotateMessage').val() }).success(function(data) { if (data != 'OK') { alert(data); + $('#annotateMessageBody').removeClass('loading'); } else { $('#annotateModal').modal('hide'); @@ -161,9 +165,17 @@ function addAnnotation(threadid) { }); } +function annotateMsgPicked() { + var val = $('#annotateMessageList').val(); + if (val) { + $('#annotateMsgId').val(val); + annotateChanged(); + } +} + function annotateChanged() { /* Enable/disable the annotate button */ - if ($('#annotateMessage').val() != '' && $('#annotateMessageList').val()) { + if ($('#annotateMessage').val() != '' && $('#annotateMsgId').val()) { $('#doAnnotateMessageButton').removeClass('disabled'); } else { |