diff --git a/plugins/gallery/main.js b/plugins/gallery/main.js index 1c996d9..23de22c 100644 --- a/plugins/gallery/main.js +++ b/plugins/gallery/main.js @@ -467,6 +467,8 @@ if (gridW <= 0) global.requestAnimationFrame(retry) } global.requestAnimationFrame(retry) + // v1.6.7:再补几次延时重测(停靠栏展开动画、首帧布局未完成时能在 1s 内自愈) + ;[120, 400, 900].forEach(function (ms) { setTimeout(function () { try { measure(); if (gridW > 0) renderGrid() } catch (e) { /* ignore */ } }, ms) }) // v1.3.0:自动恢复 —— 面板重新可见(切回 tab / 窗口聚焦 / 后台回来)且距上次拉取 >5s 时重拉一次, // 这样图床恢复、后台补图后不必手动刷新;同时保留底部「刷新」按钮做即时重试。 @@ -478,7 +480,13 @@ try { if (typeof IntersectionObserver === 'function') { var io = new IntersectionObserver(function (entries) { - for (var i = 0; i < entries.length; i++) if (entries[i].isIntersecting) autoRefresh() + for (var i = 0; i < entries.length; i++) { + if (entries[i].isIntersecting) { + // v1.6.7:面板真正可见后再量一次宽度并重排(首帧可能还是 0 宽) + try { measure(); renderGrid() } catch (e) { /* ignore */ } + autoRefresh() + } + } }, { threshold: 0.15 }) io.observe(wrap) } @@ -505,7 +513,7 @@ global.IWBPluginHost.register({ id: 'gallery', name: '图库', - version: '1.6.6', + version: '1.6.7', apiVersion: 1, capabilities: ['panels', 'gallery'], data: { schemaVersion: 1, maxBytes: 65536 }, diff --git a/plugins/gallery/manifest.json b/plugins/gallery/manifest.json index 268d5e6..9f6e6ff 100644 --- a/plugins/gallery/manifest.json +++ b/plugins/gallery/manifest.json @@ -1,7 +1,7 @@ { "id": "gallery", "name": "图库", - "version": "1.6.6", + "version": "1.6.7", "apiVersion": 1, "main": "main.js", "style": "styles.css", @@ -13,7 +13,7 @@ "图库" ], "files": { - "main.js": "9df5bc80e3b7b422481a9a4c664243d4f0ab2c0ad2e7ea940a63e4902aa62b9d", + "main.js": "691fb701ef8f8055bc6a7c3bc40e9606c7948f0350c995ee1aa07745c5d48f5c", "styles.css": "9d5b4ab1343761e51ef0c479cab96a94d3d6eaa27f0fdb500bff789ec81d70e0" } } diff --git a/plugins/index.json b/plugins/index.json index 7831a8f..d7db557 100644 --- a/plugins/index.json +++ b/plugins/index.json @@ -22,9 +22,9 @@ "dir": "gallery", "main": "main.js", "style": "styles.css", - "version": "1.6.6", + "version": "1.6.7", "files": { - "main.js": "9df5bc80e3b7b422481a9a4c664243d4f0ab2c0ad2e7ea940a63e4902aa62b9d", + "main.js": "691fb701ef8f8055bc6a7c3bc40e9606c7948f0350c995ee1aa07745c5d48f5c", "styles.css": "9d5b4ab1343761e51ef0c479cab96a94d3d6eaa27f0fdb500bff789ec81d70e0" } },