mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Fix repo home file list (#32788)
1. use grid instead of table, completely drop "ui table" from that list 2. move some "commit sign" related styles into a new file by the way (no change) because I need to figure out where `#repo-files-table` is used. 3. move legacy "branch/tag selector" related code into repo-legacy.ts, now there are 13 `import $` files left.
This commit is contained in:
		@@ -8,9 +8,7 @@ import {
 | 
			
		||||
} from './repo-issue.ts';
 | 
			
		||||
import {initUnicodeEscapeButton} from './repo-unicode-escape.ts';
 | 
			
		||||
import {initRepoBranchTagSelector} from '../components/RepoBranchTagSelector.vue';
 | 
			
		||||
import {
 | 
			
		||||
  initRepoCloneButtons, initRepoCommonBranchOrTagDropdown, initRepoCommonFilterSearchDropdown,
 | 
			
		||||
} from './repo-common.ts';
 | 
			
		||||
import {initRepoCloneButtons} from './repo-common.ts';
 | 
			
		||||
import {initCitationFileCopyContent} from './citation.ts';
 | 
			
		||||
import {initCompLabelEdit} from './comp/LabelEdit.ts';
 | 
			
		||||
import {initRepoDiffConversationNav} from './repo-diff.ts';
 | 
			
		||||
@@ -36,6 +34,33 @@ export function initBranchSelectorTabs() {
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function initRepoCommonBranchOrTagDropdown(selector: string) {
 | 
			
		||||
  $(selector).each(function () {
 | 
			
		||||
    const $dropdown = $(this);
 | 
			
		||||
    $dropdown.find('.reference.column').on('click', function () {
 | 
			
		||||
      hideElem($dropdown.find('.scrolling.reference-list-menu'));
 | 
			
		||||
      showElem($($(this).data('target')));
 | 
			
		||||
      return false;
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function initRepoCommonFilterSearchDropdown(selector: string) {
 | 
			
		||||
  const $dropdown = $(selector);
 | 
			
		||||
  if (!$dropdown.length) return;
 | 
			
		||||
 | 
			
		||||
  $dropdown.dropdown({
 | 
			
		||||
    fullTextSearch: 'exact',
 | 
			
		||||
    selectOnKeydown: false,
 | 
			
		||||
    onChange(_text, _value, $choice) {
 | 
			
		||||
      if ($choice[0].getAttribute('data-url')) {
 | 
			
		||||
        window.location.href = $choice[0].getAttribute('data-url');
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    message: {noResults: $dropdown[0].getAttribute('data-no-results')},
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export function initRepository() {
 | 
			
		||||
  if (!$('.page-content.repository').length) return;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user