summaryrefslogtreecommitdiffstats
path: root/public/js
diff options
context:
space:
mode:
authorHarshit Bansal <harshitbansal2015@gmail.com>2019-01-16 03:01:35 +0530
committertechknowlogick <hello@techknowlogick.com>2019-01-15 16:31:35 -0500
commit1ac8f6fb83b4fc3c05949f10494f325bbc65a6a7 (patch)
treebe3b5428cbfd351cbd228511859cc44547a300e4 /public/js
parent270fa6d63b9a25021d9663bd6162f4933b7eb5ff (diff)
downloadgitea-1ac8f6fb83b4fc3c05949f10494f325bbc65a6a7.tar.gz
gitea-1ac8f6fb83b4fc3c05949f10494f325bbc65a6a7.zip
Don't list an issue on its own dependency list UI. (#5658)
Fixes: #4684.
Diffstat (limited to 'public/js')
-rw-r--r--public/js/index.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 70cad04e94..c69cb753d4 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -2810,14 +2810,19 @@ function deleteDependencyModal(id, type) {
function initIssueList() {
var repolink = $('#repolink').val();
- $('.new-dependency-drop-list')
+ $('#new-dependency-drop-list')
.dropdown({
apiSettings: {
url: suburl + '/api/v1/repos/' + repolink + '/issues?q={query}',
onResponse: function(response) {
var filteredResponse = {'success': true, 'results': []};
+ var currIssueId = $('#new-dependency-drop-list').data('issue-id');
// Parse the response from the api to work with our dropdown
$.each(response, function(index, issue) {
+ // Don't list current issue in the dependency list.
+ if(issue.id === currIssueId) {
+ return;
+ }
filteredResponse.results.push({
'name' : '#' + issue.number + '&nbsp;' + htmlEncode(issue.title),
'value' : issue.id
@@ -2825,6 +2830,7 @@ function initIssueList() {
});
return filteredResponse;
},
+ cache: false,
},
fullTextSearch: true