summaryrefslogtreecommitdiffstats
path: root/public/js/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/index.js')
-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 + ' ' + issue.title,
+ 'value' : issue.id
+ });
+ });
+ return filteredResponse;
+ },
+ },
+
+ fullTextSearch: true
+ })
+ ;
+}