diff --git a/packages/mdc-dialog/adapter.ts b/packages/mdc-dialog/adapter.ts index a407c912fc3..fcb5be36963 100644 --- a/packages/mdc-dialog/adapter.ts +++ b/packages/mdc-dialog/adapter.ts @@ -38,7 +38,7 @@ interface MDCDialogAdapter { isContentScrollable(): boolean; areButtonsStacked(): boolean; - getActionFromEvent(event: Event): string | null; + getActionFromEvent(evt: Event): string | null; trapFocus(): void; releaseFocus(): void; diff --git a/packages/mdc-dialog/index.ts b/packages/mdc-dialog/index.ts index aa0ecec73b0..41456697a32 100644 --- a/packages/mdc-dialog/index.ts +++ b/packages/mdc-dialog/index.ts @@ -154,11 +154,11 @@ class MDCDialog extends MDCComponent { areButtonsStacked: () => util.areTopsMisaligned(this.buttons_), clickDefaultButton: () => this.defaultButton_ && this.defaultButton_.click(), eventTargetMatches: (target, selector) => target ? matches(target as Element, selector) : false, - getActionFromEvent: (event: Event) => { - if (!event.target) { + getActionFromEvent: (evt: Event) => { + if (!evt.target) { return ''; } - const element = closest(event.target as Element, `[${strings.ACTION_ATTRIBUTE}]`); + const element = closest(evt.target as Element, `[${strings.ACTION_ATTRIBUTE}]`); return element && element.getAttribute(strings.ACTION_ATTRIBUTE); }, hasClass: (className) => this.root_.classList.contains(className), diff --git a/packages/mdc-ripple/util.ts b/packages/mdc-ripple/util.ts index dcf88d08af5..279e25f7abd 100644 --- a/packages/mdc-ripple/util.ts +++ b/packages/mdc-ripple/util.ts @@ -111,11 +111,8 @@ export type VendorMatchesFunctionName = 'webkitMatchesSelector' | 'msMatchesSele export type MatchesFunctionName = VendorMatchesFunctionName | 'matches'; export function getMatchesProperty(htmlElementPrototype: {}): MatchesFunctionName { - /** - * Order is important because we return the first existing method we find. - * Do not change the order of the items in the below array. - */ - + // Order is important because we return the first existing method we find. + // Do not change the order of the items in the below array. const matchesMethods: MatchesFunctionName[] = ['matches', 'webkitMatchesSelector', 'msMatchesSelector']; let method: MatchesFunctionName = 'matches'; for (const matchesMethod of matchesMethods) { @@ -128,9 +125,8 @@ export function getMatchesProperty(htmlElementPrototype: {}): MatchesFunctionNam return method; } -export function getNormalizedEventCoords( - ev: Event | undefined, pageOffset: Point, clientRect: ClientRect): Point { - if (!ev) { +export function getNormalizedEventCoords(evt: Event | undefined, pageOffset: Point, clientRect: ClientRect): Point { + if (!evt) { return {x: 0, y: 0}; } const {x, y} = pageOffset; @@ -140,12 +136,12 @@ export function getNormalizedEventCoords( let normalizedX; let normalizedY; // Determine touch point relative to the ripple container. - if (ev.type === 'touchstart') { - const touchEvent = ev as TouchEvent; + if (evt.type === 'touchstart') { + const touchEvent = evt as TouchEvent; normalizedX = touchEvent.changedTouches[0].pageX - documentX; normalizedY = touchEvent.changedTouches[0].pageY - documentY; } else { - const mouseEvent = ev as MouseEvent; + const mouseEvent = evt as MouseEvent; normalizedX = mouseEvent.pageX - documentX; normalizedY = mouseEvent.pageY - documentY; }