feat: add observeScrollingInterval in coordinator plugin

This commit is contained in:
pengfei.zhou
2023-03-13 22:09:57 +08:00
committed by osborn
parent 7db5d68db5
commit 52e5977d20
12 changed files with 247 additions and 15 deletions

View File

@@ -4597,7 +4597,17 @@ function coordinator(context) {
context.callNative("coordinator", "verticalScrolling", argument);
});
}
}
},
observeScrollingInterval: function (argument) {
if (context.entity instanceof Panel) {
var panel = context.entity;
panel.addOnRenderFinishedCallback(function () {
argument.scrollable = viewIdChains(argument.scrollable);
argument.onScrolledInterval = context.function2Id(argument.onScrolledInterval);
context.callNative("coordinator", "observeScrollingInterval", argument);
});
}
},
};
}

View File

@@ -3563,7 +3563,17 @@ function coordinator(context) {
context.callNative("coordinator", "verticalScrolling", argument);
});
}
}
},
observeScrollingInterval: (argument) => {
if (context.entity instanceof Panel) {
const panel = context.entity;
panel.addOnRenderFinishedCallback(() => {
argument.scrollable = viewIdChains(argument.scrollable);
argument.onScrolledInterval = context.function2Id(argument.onScrolledInterval);
context.callNative("coordinator", "observeScrollingInterval", argument);
});
}
},
};
}

View File

@@ -5103,7 +5103,17 @@ function coordinator(context) {
context.callNative("coordinator", "verticalScrolling", argument);
});
}
}
},
observeScrollingInterval: (argument) => {
if (context.entity instanceof Panel) {
const panel = context.entity;
panel.addOnRenderFinishedCallback(() => {
argument.scrollable = viewIdChains(argument.scrollable);
argument.onScrolledInterval = context.function2Id(argument.onScrolledInterval);
context.callNative("coordinator", "observeScrollingInterval", argument);
});
}
},
};
}