Skip to content

Commit

Permalink
Add 'select all' when batch tagging whyboris#446
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesd35 committed Jul 1, 2020
1 parent 0ee71a4 commit 98edc58
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
"batchModeButton": "Batch mode",
"clickTagToAdd": "Click any tag in the tray to add the tag to all selected videos",
"clickVideoToSelect": "Click videos to select",
"selectAllButton": "Select all visible",
"closeTagTray": "Close tag tray",
"delete": "delete mode",
"filterList": "Containing",
Expand Down
1 change: 1 addition & 0 deletions src/app/components/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@
<app-tag-tray
(closeTagsTray)="closeTagsTray()"
(toggleBatchTaggingMode)="toggleBatchTaggingMode()"
(selectAll)="selectAllVisible()"
(handleTagWordClicked)="handleTagWordClicked($event.tag.name, $event.event)"
[batchTaggingMode]="batchTaggingMode"
[settingsButtons]="settingsButtons"
Expand Down
9 changes: 8 additions & 1 deletion src/app/components/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2296,7 +2296,14 @@ export class HomeComponent implements OnInit, AfterViewInit {
element.selected = false;
});
}
this.batchTaggingMode = !this.batchTaggingMode
this.batchTaggingMode = !this.batchTaggingMode;
}

/**
* Select all visible videos for batch tagging
*/
selectAllVisible(): void {
this.pipeSideEffectService.selectAll();
}

/**
Expand Down
6 changes: 6 additions & 0 deletions src/app/components/tag-tray/tag-tray.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
<span class="manual-tag-tray-label" style="line-height: 24px">
{{ 'TAGS.clickTagToAdd' | translate }}
</span>
<button
class="wizard-button wizard-button-small"
(click)="selectAll.emit()"
>
{{ 'TAGS.selectAllButton' | translate }}
</button>
</div>
</ng-template>

Expand Down
1 change: 1 addition & 0 deletions src/app/components/tag-tray/tag-tray.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export class TagTrayComponent {

@Output() closeTagsTray = new EventEmitter<any>();
@Output() toggleBatchTaggingMode = new EventEmitter<any>();
@Output() selectAll = new EventEmitter<any>();
@Output() handleTagWordClicked= new EventEmitter<TagEmit>();

@Input() batchTaggingMode;
Expand Down
9 changes: 9 additions & 0 deletions src/app/pipes/pipe-side-effect.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ export class PipeSideEffectService {

}

/**
* Set all displayed videos to selected
*/
selectAll(): void {
this.galleryShowing.forEach((element: ImageElement) => {
element.selected = true;
});
}

/**
* If pipe has an
* @param error
Expand Down

0 comments on commit 98edc58

Please sign in to comment.