Replace window report dialog usages with the TypeScript variant
This commit is contained in:
parent
ecb079b1d4
commit
0418a67780
|
@ -1,7 +1,9 @@
|
|||
import { reportDialog } from 'utilities/reportDialog';
|
||||
|
||||
export function commentReportHandler(event: Event): void {
|
||||
event.preventDefault();
|
||||
const button = event.target as HTMLButtonElement;
|
||||
const commentId = button.dataset.cId;
|
||||
|
||||
window['reportDialog']('comment', commentId);
|
||||
reportDialog('comment', commentId);
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
import { reportDialog } from 'utilities/reportDialog';
|
||||
|
||||
export function answerboxReportHandler(event: Event): void {
|
||||
event.preventDefault();
|
||||
const button = event.target as HTMLButtonElement;
|
||||
const answerId = button.dataset.aId;
|
||||
|
||||
window['reportDialog']('answer', answerId);
|
||||
reportDialog('answer', answerId);
|
||||
}
|
|
@ -1,4 +1,6 @@
|
|||
import { reportDialog } from 'utilities/reportDialog';
|
||||
|
||||
export function reportEventHandler(event: Event): void {
|
||||
const element = event.target as HTMLElement;
|
||||
window['reportDialog']('question', element.dataset.qId);
|
||||
reportDialog('question', element.dataset.qId);
|
||||
}
|
|
@ -1,7 +1,9 @@
|
|||
import { reportDialog } from 'utilities/reportDialog';
|
||||
|
||||
export function questionboxReportHandler(event: Event): void {
|
||||
event.preventDefault();
|
||||
const button = event.target as HTMLButtonElement;
|
||||
const questionId = button.dataset.qId;
|
||||
|
||||
window['reportDialog']('question', questionId);
|
||||
reportDialog('question', questionId);
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
import { reportDialog } from 'utilities/reportDialog';
|
||||
|
||||
export function userReportHandler(event: Event): void {
|
||||
event.preventDefault();
|
||||
const button: HTMLButtonElement = event.target as HTMLButtonElement;
|
||||
|
||||
window['reportDialog']('user', button.dataset.target);
|
||||
reportDialog('user', button.dataset.target);
|
||||
}
|
Loading…
Reference in New Issue