Skip to content

Commit b060751

Browse files
Merge pull request #32 from khajatakreemulla/master
submit token on click anywhere
2 parents 440fdbd + 4dd3346 commit b060751

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

frontend/src/app/anatomy/anatomy.component.ts

+9-7
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,15 @@ export class AnatomyComponent implements OnInit {
9494
this.editToken = false
9595
}
9696
}
97-
// @HostListener('document:click', ['$event'])
98-
// documentClick(event: MouseEvent) {
99-
// // your click logic
100-
// if(this.editToken && this.tokenSubmitted){
101-
// this.submitToken()
102-
// }
103-
// }
97+
@HostListener('document:click', ['$event', '$event.target'])
98+
documentClick(event: MouseEvent, targetElement: HTMLElement) {
99+
// your click logic
100+
if(targetElement.classList.contains('btn') || targetElement.classList.contains('card-body') || targetElement.classList.contains('editToken')){
101+
102+
} else if(this.editToken && !this.tokenSubmitted){
103+
this.submitToken()
104+
}
105+
}
104106

105107
public nextStep(): void {
106108
this.stepService.setStep(3);

0 commit comments

Comments
 (0)