mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Prevent exclude click in editing (bulk editor) mode
This commit is contained in:
		@@ -19,7 +19,7 @@
 | 
			
		||||
      </div>
 | 
			
		||||
      <div *ngIf="selectionModel.items" class="items">
 | 
			
		||||
        <ng-container *ngFor="let item of selectionModel.itemsSorted | filter: filterText">
 | 
			
		||||
          <app-toggleable-dropdown-button *ngIf="allowSelectNone || item.id" [item]="item" [state]="selectionModel.get(item.id)" (toggle)="selectionModel.toggle(item.id)" (exclude)="selectionModel.exclude(item.id)"></app-toggleable-dropdown-button>
 | 
			
		||||
          <app-toggleable-dropdown-button *ngIf="allowSelectNone || item.id" [item]="item" [state]="selectionModel.get(item.id)" (toggle)="selectionModel.toggle(item.id)" (exclude)="excludeClicked(item.id)"></app-toggleable-dropdown-button>
 | 
			
		||||
        </ng-container>
 | 
			
		||||
      </div>
 | 
			
		||||
      <button *ngIf="editing" class="list-group-item list-group-item-action bg-light" (click)="applyClicked()" [disabled]="!selectionModel.isDirty()">
 | 
			
		||||
 
 | 
			
		||||
@@ -91,8 +91,6 @@ export class FilterableDropdownSelectionModel {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  exclude(id: number, fireEvent:boolean = true) {
 | 
			
		||||
    console.log('exclude', id, fireEvent);
 | 
			
		||||
 | 
			
		||||
    let state = this.temporarySelectionStates.get(id)
 | 
			
		||||
    if (state == null || state != ToggleableItemState.Excluded) {
 | 
			
		||||
      this.temporarySelectionStates.set(id, ToggleableItemState.Excluded)
 | 
			
		||||
@@ -296,4 +294,12 @@ export class FilterableDropdownComponent {
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  excludeClicked(itemID: number) {
 | 
			
		||||
    if (this.editing) {
 | 
			
		||||
      this.selectionModel.toggle(itemID)
 | 
			
		||||
    } else {
 | 
			
		||||
      this.selectionModel.exclude(itemID)
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user