perf(all): minify better by using arrow functions (#18730)

This commit is contained in:
Manu MA
2019-07-10 16:33:33 +02:00
committed by Brandy Carney
parent 8beeff2c52
commit 03c1d19e07
99 changed files with 653 additions and 679 deletions

View File

@ -334,7 +334,7 @@ export class Content implements ComponentInterface {
}
}
function getParentElement(el: any) {
const getParentElement = (el: any) => {
if (el.parentElement) {
// normal element with a parent element
return el.parentElement;
@ -344,9 +344,9 @@ function getParentElement(el: any) {
return el.parentNode.host;
}
return null;
}
};
function getPageElement(el: HTMLElement) {
const getPageElement = (el: HTMLElement) => {
const tabs = el.closest('ion-tabs');
if (tabs) {
return tabs;
@ -356,15 +356,15 @@ function getPageElement(el: HTMLElement) {
return page;
}
return getParentElement(el);
}
};
// ******** DOM READ ****************
function updateScrollDetail(
const updateScrollDetail = (
detail: ScrollDetail,
el: Element,
timestamp: number,
shouldStart: boolean
) {
) => {
const prevX = detail.currentX;
const prevY = detail.currentY;
const prevT = detail.timeStamp;
@ -390,4 +390,4 @@ function updateScrollDetail(
detail.velocityX = velocityX * 0.7 + detail.velocityX * 0.3;
detail.velocityY = velocityY * 0.7 + detail.velocityY * 0.3;
}
}
};