From fe055820ea4d626b219d678e594009b4b4cbbbd0 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 20 2015 16:07:22 +0000 Subject: [PATCH 1/2] Fix commenting on the last line of a diff --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index fd72779..f4c7d86 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -456,6 +456,13 @@ var table = $( this ).parent().parent(); var nextid = rowid.replace('_' + row, '_' + (Number(row) + 1)); var next_row = table.find('#' + nextid).parent().parent(); + {# If we're at the last row, we won't be able to find the next_row + that we therefore we need to add it manually #} + if (next_row.length == 0) { + table.find("tr:last").after( + ''); + next_row = table.find('#' + nextid).parent().parent(); + } if (next_row.prev().find('.pr_comment_form').length == 0){ $.get( url , function( data ) { next_row.before( From 7d449626cbeaeeb87c0410c7e4499f2d8bd0766d Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 26 2015 10:27:50 +0000 Subject: [PATCH 2/2] Fix comment --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index f4c7d86..524706f 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -457,7 +457,7 @@ var nextid = rowid.replace('_' + row, '_' + (Number(row) + 1)); var next_row = table.find('#' + nextid).parent().parent(); {# If we're at the last row, we won't be able to find the next_row - that we therefore we need to add it manually #} + therefore we need to add it manually #} if (next_row.length == 0) { table.find("tr:last").after( '');