diff --git a/pagure/templates/comment_update.html b/pagure/templates/comment_update.html index ecd590f..7e943dc 100644 --- a/pagure/templates/comment_update.html +++ b/pagure/templates/comment_update.html @@ -12,19 +12,23 @@ id="comment_block">
- +
{{ form.csrf_token }}
- + - +
{% if not is_js %} {% endif %} + {% endblock %} diff --git a/pagure/templates/issue.html b/pagure/templates/issue.html index ddef187..3238906 100644 --- a/pagure/templates/issue.html +++ b/pagure/templates/issue.html @@ -336,14 +336,26 @@ $(function() { success: function(res) { var el = $('#comment-' + commentid); var sec = el.parent().children()[1]; - $(sec).html(res); + $(sec).hide(); + $(sec).after(res); + cancel_edit_btn(); }, error: function() { alert('Could not make edit work'); } }); return false; - }) + }); + + function cancel_edit_btn() { + $( ".cancel" ).click( + function() { + $(this).parent().parent().parent().parent().parent().find('.comment_body').show(); + $(this).parent().parent().parent().parent().remove(); + return false; + } + ); + }; });