diff options
author | Zsombor <gzsombor@users.noreply.github.com> | 2017-08-24 14:30:27 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-08-24 15:30:27 +0300 |
commit | da230a287264d38156e950a3149e43f65599e65b (patch) | |
tree | 4c5f4d16186f2d201515f77fdf99e9d3fc90df95 /public/js | |
parent | 174255e74ee2c07e685913ab8bce08fc046569f0 (diff) | |
download | gitea-da230a287264d38156e950a3149e43f65599e65b.tar.gz gitea-da230a287264d38156e950a3149e43f65599e65b.zip |
Add possibility to record branch or tag information in an issue (#780)
Diffstat (limited to 'public/js')
-rw-r--r-- | public/js/index.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/public/js/index.js b/public/js/index.js index 90a61d7529..1b6f2f601e 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -86,6 +86,22 @@ function initEditForm() { initEditDiffTab($('.edit.form')); } +function initBranchSelector() { + var $selectBranch = $('.ui.select-branch') + var $branchMenu = $selectBranch.find('.reference-list-menu'); + $branchMenu.find('.item:not(.no-select)').click(function () { + var selectedValue = $(this).data('id'); + $($(this).data('id-selector')).val(selectedValue); + $selectBranch.find('.ui .branch-name').text(selectedValue); + }); + $selectBranch.find('.reference.column').click(function () { + $selectBranch.find('.scrolling.reference-list-menu').css('display', 'none'); + $selectBranch.find('.reference .text').removeClass('black'); + $($(this).data('target')).css('display', 'block'); + $(this).find('.text').addClass('black'); + return false; + }); +} function updateIssuesMeta(url, action, issueIds, elementId, afterSuccess) { $.ajax({ @@ -106,6 +122,7 @@ function initCommentForm() { return } + initBranchSelector(); initCommentPreviewTab($('.comment.form')); // Labels |