@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.cjs.js
CHANGED
|
@@ -239,7 +239,7 @@ const clearTimeout$1 = (timerId) => loadOrReturnBroker().clearTimeout(timerId);
|
|
|
239
239
|
const setInterval$1 = (...args) => loadOrReturnBroker().setInterval(...args);
|
|
240
240
|
const setTimeout$1 = (...args) => loadOrReturnBroker().setTimeout(...args);
|
|
241
241
|
|
|
242
|
-
const version = "2.11.
|
|
242
|
+
const version = "2.11.11";
|
|
243
243
|
|
|
244
244
|
/* eslint-disable */
|
|
245
245
|
// ==UserScript==
|
|
@@ -6208,6 +6208,10 @@ class Utils {
|
|
|
6208
6208
|
if (typeof deviation !== "number" || Number.isNaN(deviation)) {
|
|
6209
6209
|
deviation = 10;
|
|
6210
6210
|
}
|
|
6211
|
+
// 最大值 2147483647
|
|
6212
|
+
// const maxZIndex = Math.pow(2, 31) - 1;
|
|
6213
|
+
// 比较值 2000000000
|
|
6214
|
+
const maxZIndexCompare = 2 * Math.pow(10, 9);
|
|
6211
6215
|
/** 坐标偏移 */
|
|
6212
6216
|
const positionDistance = 10;
|
|
6213
6217
|
const defaultCalcPostion = [];
|
|
@@ -6302,9 +6306,15 @@ class Utils {
|
|
|
6302
6306
|
left: maxRect.left,
|
|
6303
6307
|
};
|
|
6304
6308
|
}
|
|
6309
|
+
const calcZIndex = zIndex + deviation;
|
|
6310
|
+
if (calcZIndex >= maxZIndexCompare) {
|
|
6311
|
+
// 不要超过最大值
|
|
6312
|
+
// 超过就忽略
|
|
6313
|
+
return;
|
|
6314
|
+
}
|
|
6305
6315
|
return {
|
|
6306
6316
|
/** 计算偏移量后的z-index值 */
|
|
6307
|
-
zIndex:
|
|
6317
|
+
zIndex: calcZIndex,
|
|
6308
6318
|
/** 获取到的最大的z-index值 */
|
|
6309
6319
|
originZIndex: zIndex,
|
|
6310
6320
|
/** 拥有最大z-index的元素 */
|