@tarojs/plugin-platform-harmony-ets 4.0.0-beta.27 → 4.0.0-beta.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -30,14 +30,14 @@ export class IntersectionObserver implements Taro.IntersectionObserver {
|
|
|
30
30
|
this._observerNodes.forEach((n: TaroElement & any) => {
|
|
31
31
|
disconnectEvent(n, VISIBLE_CHANGE_EVENT_NAME)
|
|
32
32
|
// @ts-ignore
|
|
33
|
-
n._nodeInfo
|
|
33
|
+
n._nodeInfo.thresholds = null
|
|
34
34
|
})
|
|
35
35
|
} else {
|
|
36
36
|
disconnectEvent(this._observerNodes, VISIBLE_CHANGE_EVENT_NAME)
|
|
37
37
|
// @ts-ignore
|
|
38
38
|
if (this._observerNodes._nodeInfo) {
|
|
39
39
|
// @ts-ignore
|
|
40
|
-
this._observerNodes._nodeInfo
|
|
40
|
+
this._observerNodes._nodeInfo.thresholds = null
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -54,7 +54,7 @@ export class IntersectionObserver implements Taro.IntersectionObserver {
|
|
|
54
54
|
if (node instanceof Array) {
|
|
55
55
|
node.forEach(n => {
|
|
56
56
|
// @ts-ignore
|
|
57
|
-
n._nodeInfo
|
|
57
|
+
n._nodeInfo.thresholds = thresholds
|
|
58
58
|
|
|
59
59
|
setNodeEventCallbackAndTriggerComponentUpdate(n, VISIBLE_CHANGE_EVENT_NAME, (isVisible: boolean, currentRatio: number) => {
|
|
60
60
|
callback(this.handleResult(isVisible, currentRatio, n))
|
|
@@ -62,7 +62,7 @@ export class IntersectionObserver implements Taro.IntersectionObserver {
|
|
|
62
62
|
})
|
|
63
63
|
} else {
|
|
64
64
|
// @ts-ignore
|
|
65
|
-
node._nodeInfo
|
|
65
|
+
node._nodeInfo.thresholds = thresholds
|
|
66
66
|
|
|
67
67
|
setNodeEventCallbackAndTriggerComponentUpdate(node, VISIBLE_CHANGE_EVENT_NAME, (isVisible: boolean, currentRatio: number) => {
|
|
68
68
|
callback(this.handleResult(isVisible, currentRatio, node))
|
package/dist/runtime-utils.js
CHANGED
|
@@ -4009,14 +4009,12 @@ class IntersectionObserver {
|
|
|
4009
4009
|
Object.assign(this._options, options);
|
|
4010
4010
|
}
|
|
4011
4011
|
disconnect() {
|
|
4012
|
-
var _a;
|
|
4013
4012
|
if (this._observerNodes && this._component) {
|
|
4014
4013
|
if (this._observerNodes instanceof Array) {
|
|
4015
4014
|
this._observerNodes.forEach((n) => {
|
|
4016
|
-
var _a;
|
|
4017
4015
|
disconnectEvent(n, VISIBLE_CHANGE_EVENT_NAME);
|
|
4018
4016
|
// @ts-ignore
|
|
4019
|
-
|
|
4017
|
+
n._nodeInfo.thresholds = null;
|
|
4020
4018
|
});
|
|
4021
4019
|
}
|
|
4022
4020
|
else {
|
|
@@ -4024,13 +4022,12 @@ class IntersectionObserver {
|
|
|
4024
4022
|
// @ts-ignore
|
|
4025
4023
|
if (this._observerNodes._nodeInfo) {
|
|
4026
4024
|
// @ts-ignore
|
|
4027
|
-
|
|
4025
|
+
this._observerNodes._nodeInfo.thresholds = null;
|
|
4028
4026
|
}
|
|
4029
4027
|
}
|
|
4030
4028
|
}
|
|
4031
4029
|
}
|
|
4032
4030
|
observe(targetSelector, callback) {
|
|
4033
|
-
var _a;
|
|
4034
4031
|
if (!this._component)
|
|
4035
4032
|
return;
|
|
4036
4033
|
const { observeAll, thresholds } = this._options;
|
|
@@ -4039,9 +4036,8 @@ class IntersectionObserver {
|
|
|
4039
4036
|
if (node) {
|
|
4040
4037
|
if (node instanceof Array) {
|
|
4041
4038
|
node.forEach(n => {
|
|
4042
|
-
var _a;
|
|
4043
4039
|
// @ts-ignore
|
|
4044
|
-
|
|
4040
|
+
n._nodeInfo.thresholds = thresholds;
|
|
4045
4041
|
setNodeEventCallbackAndTriggerComponentUpdate(n, VISIBLE_CHANGE_EVENT_NAME, (isVisible, currentRatio) => {
|
|
4046
4042
|
callback(this.handleResult(isVisible, currentRatio, n));
|
|
4047
4043
|
});
|
|
@@ -4049,7 +4045,7 @@ class IntersectionObserver {
|
|
|
4049
4045
|
}
|
|
4050
4046
|
else {
|
|
4051
4047
|
// @ts-ignore
|
|
4052
|
-
|
|
4048
|
+
node._nodeInfo.thresholds = thresholds;
|
|
4053
4049
|
setNodeEventCallbackAndTriggerComponentUpdate(node, VISIBLE_CHANGE_EVENT_NAME, (isVisible, currentRatio) => {
|
|
4054
4050
|
callback(this.handleResult(isVisible, currentRatio, node));
|
|
4055
4051
|
});
|