feat:should receive multi onRenderFinishedCallbacks
This commit is contained in:
20
doric-web/dist/index.js
vendored
20
doric-web/dist/index.js
vendored
@@ -2186,6 +2186,7 @@ class Panel {
|
||||
constructor() {
|
||||
this.__root__ = new Root;
|
||||
this.headviews = new Map;
|
||||
this.onRenderFinishedCallback = [];
|
||||
}
|
||||
onCreate() { }
|
||||
onDestroy() { }
|
||||
@@ -2337,11 +2338,18 @@ class Panel {
|
||||
});
|
||||
}
|
||||
Promise.all(promises).then(_ => {
|
||||
if (this.onRenderFinished) {
|
||||
this.onRenderFinished();
|
||||
}
|
||||
this.onRenderFinished();
|
||||
});
|
||||
}
|
||||
onRenderFinished() {
|
||||
this.onRenderFinishedCallback.forEach(e => {
|
||||
e();
|
||||
});
|
||||
this.onRenderFinishedCallback.length = 0;
|
||||
}
|
||||
addOnRenderFinishedCallback(cb) {
|
||||
this.onRenderFinishedCallback.push(cb);
|
||||
}
|
||||
}
|
||||
__decorate$2([
|
||||
NativeCall,
|
||||
@@ -3726,7 +3734,7 @@ function coordinator(context) {
|
||||
verticalScrolling: (argument) => {
|
||||
if (context.entity instanceof Panel) {
|
||||
const panel = context.entity;
|
||||
panel.onRenderFinished = () => {
|
||||
panel.addOnRenderFinishedCallback(() => {
|
||||
argument.scrollable = viewIdChains(argument.scrollable);
|
||||
if (argument.target instanceof View) {
|
||||
argument.target = viewIdChains(argument.target);
|
||||
@@ -3737,8 +3745,8 @@ function coordinator(context) {
|
||||
if (argument.changing.end instanceof Color) {
|
||||
argument.changing.end = argument.changing.end.toModel();
|
||||
}
|
||||
return context.callNative("coordinator", "verticalScrolling", argument);
|
||||
};
|
||||
context.callNative("coordinator", "verticalScrolling", argument);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
2
doric-web/dist/index.js.map
vendored
2
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user