Skip to content

Commit

Permalink
[mgt-tasks] re-work of taskClick event
Browse files Browse the repository at this point in the history
  • Loading branch information
vogtn committed Nov 2, 2019
1 parent 566e22e commit ef2c2d9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/components/mgt-tasks/mgt-tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ export class MgtTasks extends MgtTemplatedComponent {
<span class="TaskDetail TaskPeople">
<span
@click=${(e: MouseEvent) => {
this.handleTaskClick(e, task);
this.handleTaskClick(e, null);
this.showPeoplePicker(task);
}}
>
Expand Down Expand Up @@ -1039,7 +1039,7 @@ export class MgtTasks extends MgtTemplatedComponent {
<span
class="TaskDetail TaskBucket"
@click=${(e: MouseEvent) => {
this.handleTaskClick(e, task);
this.handleTaskClick(e, null);
this.showPeoplePicker(task);
}}
>
Expand Down Expand Up @@ -1081,7 +1081,12 @@ export class MgtTasks extends MgtTemplatedComponent {
Task: true
})}
>
<div class="TaskContent">
<div
class="TaskContent"
@click=${(e: MouseEvent) => {
this.handleTaskClick(e, task);
}}
>
<span
class=${classMap({
Complete: completed,
Expand Down Expand Up @@ -1110,9 +1115,11 @@ export class MgtTasks extends MgtTemplatedComponent {
}

private handleTaskClick(event, task: ITask) {
this.fireCustomEvent('taskClick', { task });
event.stopPropagation();
event.preventDefault();
if (task) {
this.fireCustomEvent('taskClick', { task });
}
}

private renderLoadingTask() {
Expand Down

0 comments on commit ef2c2d9

Please sign in to comment.