@whitesev/utils 2.11.9 → 2.11.11
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/dist/index.amd.js +12 -2
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +12 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +12 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +12 -2
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +12 -2
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +12 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/Utils.d.ts +2 -2
- package/package.json +1 -1
- package/src/Utils.ts +14 -4
package/dist/index.esm.js
CHANGED
|
@@ -237,7 +237,7 @@ const clearTimeout$1 = (timerId) => loadOrReturnBroker().clearTimeout(timerId);
|
|
|
237
237
|
const setInterval$1 = (...args) => loadOrReturnBroker().setInterval(...args);
|
|
238
238
|
const setTimeout$1 = (...args) => loadOrReturnBroker().setTimeout(...args);
|
|
239
239
|
|
|
240
|
-
const version = "2.11.
|
|
240
|
+
const version = "2.11.11";
|
|
241
241
|
|
|
242
242
|
/* eslint-disable */
|
|
243
243
|
// ==UserScript==
|
|
@@ -6206,6 +6206,10 @@ class Utils {
|
|
|
6206
6206
|
if (typeof deviation !== "number" || Number.isNaN(deviation)) {
|
|
6207
6207
|
deviation = 10;
|
|
6208
6208
|
}
|
|
6209
|
+
// 最大值 2147483647
|
|
6210
|
+
// const maxZIndex = Math.pow(2, 31) - 1;
|
|
6211
|
+
// 比较值 2000000000
|
|
6212
|
+
const maxZIndexCompare = 2 * Math.pow(10, 9);
|
|
6209
6213
|
/** 坐标偏移 */
|
|
6210
6214
|
const positionDistance = 10;
|
|
6211
6215
|
const defaultCalcPostion = [];
|
|
@@ -6300,9 +6304,15 @@ class Utils {
|
|
|
6300
6304
|
left: maxRect.left,
|
|
6301
6305
|
};
|
|
6302
6306
|
}
|
|
6307
|
+
const calcZIndex = zIndex + deviation;
|
|
6308
|
+
if (calcZIndex >= maxZIndexCompare) {
|
|
6309
|
+
// 不要超过最大值
|
|
6310
|
+
// 超过就忽略
|
|
6311
|
+
return;
|
|
6312
|
+
}
|
|
6303
6313
|
return {
|
|
6304
6314
|
/** 计算偏移量后的z-index值 */
|
|
6305
|
-
zIndex:
|
|
6315
|
+
zIndex: calcZIndex,
|
|
6306
6316
|
/** 获取到的最大的z-index值 */
|
|
6307
6317
|
originZIndex: zIndex,
|
|
6308
6318
|
/** 拥有最大z-index的元素 */
|