oipage 1.8.0-alpha.0 → 1.8.0-alpha.1
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.
- package/nodejs/animation/index.js +17 -9
- package/nodejs/cmdlog/index.js +1 -1
- package/nodejs/disk/index.js +1 -1
- package/nodejs/format/index.js +1 -1
- package/nodejs/json/index.js +1 -1
- package/nodejs/logform/index.js +1 -1
- package/nodejs/reader/index.js +1 -1
- package/nodejs/throttle/index.js +1 -1
- package/package.json +1 -1
- package/web/XMLHttpRequest/index.js +1 -1
- package/web/animation/index.js +17 -9
- package/web/format/index.js +1 -1
- package/web/json/index.js +1 -1
- package/web/onReady/index.js +1 -1
- package/web/performChunk/index.js +1 -1
- package/web/reader/index.js +1 -1
- package/web/style/index.js +1 -1
- package/web/throttle/index.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* animation of OIPage v1.8.0-alpha.
|
|
2
|
+
* animation of OIPage v1.8.0-alpha.1
|
|
3
3
|
* git+https://github.com/oi-contrib/OIPage.git
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -43,12 +43,16 @@ function animation(doback, duration, callback) {
|
|
|
43
43
|
//开启唯一的定时器timerId
|
|
44
44
|
"start": function () {
|
|
45
45
|
if (!$timerId) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
try {
|
|
47
|
+
if (globalThis && globalThis.requestAnimationFrame) {
|
|
48
|
+
$timerId = globalThis.requestAnimationFrame(function step() {
|
|
49
|
+
clock.tick();
|
|
50
|
+
if ($timerId) $timerId = globalThis.requestAnimationFrame(step);
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
$timerId = setInterval(clock.tick, $interval);
|
|
54
|
+
}
|
|
55
|
+
} catch (e) {
|
|
52
56
|
$timerId = setInterval(clock.tick, $interval);
|
|
53
57
|
}
|
|
54
58
|
}
|
|
@@ -88,8 +92,12 @@ function animation(doback, duration, callback) {
|
|
|
88
92
|
//停止定时器,重置timerId=null
|
|
89
93
|
"stop": function () {
|
|
90
94
|
if ($timerId) {
|
|
91
|
-
|
|
92
|
-
|
|
95
|
+
try {
|
|
96
|
+
if (globalThis && globalThis.requestAnimationFrame) globalThis.cancelAnimationFrame($timerId);
|
|
97
|
+
else clearInterval($timerId);
|
|
98
|
+
} catch (e) {
|
|
99
|
+
clearInterval($timerId);
|
|
100
|
+
}
|
|
93
101
|
$timerId = null;
|
|
94
102
|
}
|
|
95
103
|
}
|
package/nodejs/cmdlog/index.js
CHANGED
package/nodejs/disk/index.js
CHANGED
package/nodejs/format/index.js
CHANGED
package/nodejs/json/index.js
CHANGED
package/nodejs/logform/index.js
CHANGED
package/nodejs/reader/index.js
CHANGED
package/nodejs/throttle/index.js
CHANGED
package/package.json
CHANGED
package/web/animation/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* animation of OIPage v1.8.0-alpha.
|
|
2
|
+
* animation of OIPage v1.8.0-alpha.1
|
|
3
3
|
* git+https://github.com/oi-contrib/OIPage.git
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -43,12 +43,16 @@ export function animation(doback, duration, callback) {
|
|
|
43
43
|
//开启唯一的定时器timerId
|
|
44
44
|
"start": function () {
|
|
45
45
|
if (!$timerId) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
try {
|
|
47
|
+
if (globalThis && globalThis.requestAnimationFrame) {
|
|
48
|
+
$timerId = globalThis.requestAnimationFrame(function step() {
|
|
49
|
+
clock.tick();
|
|
50
|
+
if ($timerId) $timerId = globalThis.requestAnimationFrame(step);
|
|
51
|
+
});
|
|
52
|
+
} else {
|
|
53
|
+
$timerId = setInterval(clock.tick, $interval);
|
|
54
|
+
}
|
|
55
|
+
} catch (e) {
|
|
52
56
|
$timerId = setInterval(clock.tick, $interval);
|
|
53
57
|
}
|
|
54
58
|
}
|
|
@@ -88,8 +92,12 @@ export function animation(doback, duration, callback) {
|
|
|
88
92
|
//停止定时器,重置timerId=null
|
|
89
93
|
"stop": function () {
|
|
90
94
|
if ($timerId) {
|
|
91
|
-
|
|
92
|
-
|
|
95
|
+
try {
|
|
96
|
+
if (globalThis && globalThis.requestAnimationFrame) globalThis.cancelAnimationFrame($timerId);
|
|
97
|
+
else clearInterval($timerId);
|
|
98
|
+
} catch (e) {
|
|
99
|
+
clearInterval($timerId);
|
|
100
|
+
}
|
|
93
101
|
$timerId = null;
|
|
94
102
|
}
|
|
95
103
|
}
|
package/web/format/index.js
CHANGED
package/web/json/index.js
CHANGED
package/web/onReady/index.js
CHANGED
package/web/reader/index.js
CHANGED
package/web/style/index.js
CHANGED
package/web/throttle/index.js
CHANGED