mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
perf(all): minify better by using arrow functions (#18730)
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user