mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 20:36:07 +01:00 
			
		
		
		
	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:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user