Skip to content

Commit

Permalink
feat(list-view): expend click area of checkbox to improving user expe…
Browse files Browse the repository at this point in the history
…rience

click surrending area of checkbox or area of operation will toggle checkbox
  • Loading branch information
ElonH committed Jun 13, 2020
1 parent bf03dd1 commit 988a219
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/app/pages/manager/fileMode/listView/listView.component.ts
Expand Up @@ -36,11 +36,11 @@ import { ClipboardService } from '../../clipboard/clipboard.service';
[selectAllTemplate]="secAll"
(event)="eventEmitted($event)"
>
<ng-template let-row>
<td (dblclick)="$event.stopPropagation()">
<ng-template let-row let-idx="index">
<td (dblclick)="$event.stopPropagation()" (click)="toggle(idx); $event.preventDefault()">
<nb-checkbox [(checked)]="row.check" (checkedChange)="onToggle()"> </nb-checkbox>
</td>
<td>
<td (click)="toggle(idx)">
<nb-icon
*ngIf="row.ManipulateIcon"
class="manipulation"
Expand Down Expand Up @@ -143,6 +143,10 @@ export class ListViewComponent implements OnInit, OnDestroy {
this.checAllInteral = true;
}
}
toggle(idx: number) {
this.data[idx].check = !this.data[idx].check;
this.onToggle();
}

manipulate(o: IManipulate) {
this.data.forEach(x => {
Expand Down

0 comments on commit 988a219

Please sign in to comment.