summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorkolaente <konrad@kola-entertainments.de>2018-07-17 23:23:58 +0200
committertechknowlogick <techknowlogick@users.noreply.github.com>2018-07-17 17:23:58 -0400
commit1bff02de55331e11de3627d5c5628feb2cd97387 (patch)
treed6d6ace5f246c1555b294bf096763260f7d74d7b /public
parent7be5935c55dcdf198efdf1306bbeb2b54aa0b900 (diff)
downloadgitea-1bff02de55331e11de3627d5c5628feb2cd97387.tar.gz
gitea-1bff02de55331e11de3627d5c5628feb2cd97387.zip
Added dependencies for issues (#2196) (#2531)
Diffstat (limited to 'public')
-rw-r--r--public/js/index.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 21a55d0e44..696b63e778 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -1769,6 +1769,7 @@ $(document).ready(function () {
initTopicbar();
initU2FAuth();
initU2FRegister();
+ initIssueList();
// Repo clone url.
if ($('#repo-clone-url').length > 0) {
@@ -2488,3 +2489,41 @@ function updateDeadline(deadlineString) {
}
});
}
+
+function deleteDependencyModal(id, type) {
+ $('.remove-dependency')
+ .modal({
+ closable: false,
+ duration: 200,
+ onApprove: function () {
+ $('#removeDependencyID').val(id);
+ $('#dependencyType').val(type);
+ $('#removeDependencyForm').submit();
+ }
+ }).modal('show')
+ ;
+}
+
+function initIssueList() {
+ var repolink = $('#repolink').val();
+ $('.new-dependency-drop-list')
+ .dropdown({
+ apiSettings: {
+ url: '/api/v1/repos' + repolink + '/issues?q={query}',
+ onResponse: function(response) {
+ var filteredResponse = {'success': true, 'results': []};
+ // Parse the response from the api to work with our dropdown
+ $.each(response, function(index, issue) {
+ filteredResponse.results.push({
+ 'name' : '#' + issue.number + '&nbsp;' + issue.title,
+ 'value' : issue.id
+ });
+ });
+ return filteredResponse;
+ },
+ },
+
+ fullTextSearch: true
+ })
+ ;
+}