mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fix duplicate modals when clicking on "remove all" repository button (#24129)
Under Team tab of an organization, click on "remove all" repositories button will trigger two modals. Because `data-modal-id` is not proerly added. Before: https://user-images.githubusercontent.com/17645053/231988545-ac690b86-e3fe-4bf5-81c6-5ef09302e849.mov After: https://user-images.githubusercontent.com/17645053/231989678-53be4f91-fdc9-4bc5-ba11-a08aa4548e37.mov
This commit is contained in:
		@@ -194,8 +194,8 @@ export function initGlobalLinkActions() {
 | 
			
		||||
    const $this = $(this);
 | 
			
		||||
    const dataArray = $this.data();
 | 
			
		||||
    let filter = '';
 | 
			
		||||
    if ($this.data('modal-id')) {
 | 
			
		||||
      filter += `#${$this.data('modal-id')}`;
 | 
			
		||||
    if ($this.attr('data-modal-id')) {
 | 
			
		||||
      filter += `#${$this.attr('data-modal-id')}`;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const dialog = $(`.delete.modal${filter}`);
 | 
			
		||||
@@ -237,8 +237,8 @@ export function initGlobalLinkActions() {
 | 
			
		||||
    e.preventDefault();
 | 
			
		||||
    const $this = $(this);
 | 
			
		||||
    let filter = '';
 | 
			
		||||
    if ($this.attr('id')) {
 | 
			
		||||
      filter += `#${$this.attr('id')}`;
 | 
			
		||||
    if ($this.attr('data-modal-id')) {
 | 
			
		||||
      filter += `#${$this.attr('data-modal-id')}`;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const dialog = $(`.addall.modal${filter}`);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user