Add selecting tags on the compare page (#15723)
* Add selecting tags on the compare page * Remove unused condition and change indentation * Fix tag tab in dropdown to be black * Add compare tag integration test Co-authored-by: Jonathan Tran <jon@allspice.io>
This commit is contained in:
parent
4900881924
commit
9557b8603a
5 changed files with 235 additions and 100 deletions
|
@ -1241,10 +1241,16 @@ async function initRepository() {
|
|||
$(this).select();
|
||||
});
|
||||
|
||||
// Compare or pull request
|
||||
const $repoDiff = $('.repository.diff');
|
||||
if ($repoDiff.length) {
|
||||
initBranchOrTagDropdown('.choose.branch .dropdown');
|
||||
initFilterSearchDropdown('.choose.branch .dropdown');
|
||||
}
|
||||
|
||||
// Pull request
|
||||
const $repoComparePull = $('.repository.compare.pull');
|
||||
if ($repoComparePull.length > 0) {
|
||||
initFilterSearchDropdown('.choose.branch .dropdown');
|
||||
// show pull request form
|
||||
$repoComparePull.find('button.show-form').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
@ -3447,6 +3453,17 @@ function initIssueTimetracking() {
|
|||
});
|
||||
}
|
||||
|
||||
function initBranchOrTagDropdown(selector) {
|
||||
$(selector).each(function() {
|
||||
const $dropdown = $(this);
|
||||
$dropdown.find('.reference.column').on('click', function () {
|
||||
$dropdown.find('.scrolling.reference-list-menu').hide();
|
||||
$($(this).data('target')).show();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function initFilterBranchTagDropdown(selector) {
|
||||
$(selector).each(function () {
|
||||
const $dropdown = $(this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue