Skip to content

Commit

Permalink
flash on mouse event too
Browse files Browse the repository at this point in the history
  • Loading branch information
jyannick committed Jun 4, 2022
1 parent cd5070f commit 98feb83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/todo-item/todo-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class TodoItemComponent {

@Input() todo?: Todo;
@Output() todoChange = new EventEmitter<Todo>();
@Output() flash = new EventEmitter<void>();

private _isEditing: boolean = false;

Expand All @@ -43,6 +44,9 @@ export class TodoItemComponent {

markDone() {
this.modifyTodo((todo) => {
if (!todo.done) {
this.flash.emit();
}
todo.done = true;
return todo;
});
Expand Down
1 change: 1 addition & 0 deletions src/app/todo-list/todo-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<yaka-todo-item
[(todo)]="todos[index]"
(todoChange)="save()"
(flash)="this.flash.emit();"
[selected]="index === selectedTodo"
[(isEditing)]="isEditing"
(click)="selectTodo(index)"
Expand Down

0 comments on commit 98feb83

Please sign in to comment.