From e48fcab77f95b5834964cc8e440a92ba835aa9e9 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 04 2018 10:03:18 +0000 Subject: Fix selecting branch containing multiple dots We were only handling branch name containing one dot, with this commit we're supporting branch names containing multiple dots. Fixes https://pagure.io/pagure/issue/3071 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/repo_info.html b/pagure/templates/repo_info.html index c49d430..ac4b372 100644 --- a/pagure/templates/repo_info.html +++ b/pagure/templates/repo_info.html @@ -352,7 +352,7 @@ $(function() { commit not in the main branch. Click to create new PR now.'+'"> New PR \ '; {%endif%} - var _b = branch.replace('.', '\\.').replace('/', '__').replace('\+', '\\+'); + var _b = branch.replace(/\./g, '\\.').replace('/', '__').replace('\+', '\\+'); $('#branch-' + _b + ' .branch_del').prepend(html2); $('[data-toggle="tooltip"]').tooltip({placement : 'bottom'}); } @@ -370,7 +370,7 @@ $(function() { title="' + branch +' is already in an opened pull-request">' + 'PR#' + res.message.branch_w_pr[branch] + ' \ '; - $('#branch-' + branch.replace('.', '\\.').replace('/', '__') + $('#branch-' + branch.replace(/\./g, '\\.').replace('/', '__') + ' .branch_del').prepend(html); $('[data-toggle="tooltip"]').tooltip({placement : 'bottom'}); }