mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Add unset default project column (#23531)
Close: https://github.com/go-gitea/gitea/issues/23401
This commit is contained in:
		@@ -126,19 +126,30 @@ export function initRepoProject() {
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  $(document).on('click', '.set-default-project-board', async function (e) {
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
  $('.default-project-board-modal').each(function () {
 | 
			
		||||
    const boardColumn = $(this).closest('.board-column');
 | 
			
		||||
    const showButton = $(boardColumn).find('.default-project-board-show');
 | 
			
		||||
    const commitButton = $(this).find('.default-project-board-button');
 | 
			
		||||
 | 
			
		||||
    await $.ajax({
 | 
			
		||||
      method: 'POST',
 | 
			
		||||
      url: $(this).data('url'),
 | 
			
		||||
      headers: {
 | 
			
		||||
        'X-Csrf-Token': csrfToken,
 | 
			
		||||
      },
 | 
			
		||||
      contentType: 'application/json',
 | 
			
		||||
    if ($(showButton).data('type') === 'unset_default') {
 | 
			
		||||
      $(commitButton).removeClass('primary');
 | 
			
		||||
      $(commitButton).addClass('red');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    $(commitButton).on('click', (e) => {
 | 
			
		||||
      e.preventDefault();
 | 
			
		||||
 | 
			
		||||
      $.ajax({
 | 
			
		||||
        method: 'POST',
 | 
			
		||||
        url: $(showButton).data('url'),
 | 
			
		||||
        headers: {
 | 
			
		||||
          'X-Csrf-Token': csrfToken,
 | 
			
		||||
        },
 | 
			
		||||
        contentType: 'application/json',
 | 
			
		||||
      }).done(() => {
 | 
			
		||||
        window.location.reload();
 | 
			
		||||
      });
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    window.location.reload();
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  $('.delete-project-board').each(function () {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user