fix(out): 加载/失败类打到最近的 .iwb-out-cell(img 被浮层包裹,parentElement 不是单元格)
This commit is contained in:
1 parent
420e87628e
commit
49d11744a6
2 files changed
+13
-3
No files matched your search
+12
-2
@@ -899,7 +899,16 @@
|
||||
const phEl = (!_localSrc && !(ingSt && ingSt.localUrl) && /^https?:/i.test(String((r && r.url) || '')))
|
||||
? el('div', { className: 'iwb-out-cell-ph', key: 'ph' }, el('span', { className: 'iwb-out-cell-ph-txt' }, '下载中…'))
|
||||
: null
|
||||
const imgEl = el('img', { key: 'out-img-' + cur + '-' + String(r.url || '').slice(-48), className: 'iwb-out-cell-img', decoding: 'async', fetchPriority: 'low', referrerPolicy: 'no-referrer', onLoad: (e) => { try { const im = e && e.currentTarget; if (im) { im.classList.add('is-loaded'); if (im.parentElement) im.parentElement.classList.add('is-loaded-cell') } } catch (e0) { /* ignore */ } }, src: (function () {
|
||||
const imgEl = el('img', { key: 'out-img-' + cur + '-' + String(r.url || '').slice(-48), className: 'iwb-out-cell-img', decoding: 'async', fetchPriority: 'low', referrerPolicy: 'no-referrer', onLoad: (e) => {
|
||||
// 2026-12-02:img 被包在下载浮层(.iwb-dl-ov)里,parentElement 不是单元格 —— 必须向上找 .iwb-out-cell
|
||||
try {
|
||||
const im = e && e.currentTarget
|
||||
if (!im) return
|
||||
im.classList.add('is-loaded')
|
||||
const cell = (im.closest && im.closest('.iwb-out-cell')) || im.parentElement
|
||||
if (cell) cell.classList.add('is-loaded-cell')
|
||||
} catch (e0) { /* ignore */ }
|
||||
}, src: (function () {
|
||||
var need = Math.max(120, Math.min(360, (node && node.w ? node.w - 40 : 240)))
|
||||
var pick = (typeof wImgSrcForNode === 'function') ? wImgSrcForNode : wDisplayThumbOf
|
||||
// 本地源(已落库/已入缩略图缓存)才走 LOD —— 避免 thumbOf 回落到远程后又整幅解码原图
|
||||
@@ -915,7 +924,8 @@
|
||||
if (im.dataset && im.dataset.fb !== 'remote' && r && r.url) { im.dataset.fb = 'remote'; im.src = r.url; return }
|
||||
if (im.dataset) im.dataset.fb = 'broken'
|
||||
im.classList.add('is-broken')
|
||||
if (im.parentElement) im.parentElement.classList.add('is-broken-cell')
|
||||
const cellB = (im.closest && im.closest('.iwb-out-cell')) || im.parentElement
|
||||
if (cellB) cellB.classList.add('is-broken-cell')
|
||||
} catch (e1) { /* ignore */ }
|
||||
}, onPointerDown: (e) => { e.stopPropagation(); props.onSelect && props.onSelect(node.id) }, onDragStart: (e) => { try { const u = r.url || ''; e.dataTransfer.setData('application/x-iwb-output-ref', u); e.dataTransfer.setData('text/plain', u); e.dataTransfer.effectAllowed = 'copy' } catch (err) { /* 浏览器拒写自定义 MIME 时仍保留 text/plain */ } }, onDoubleClick: (e) => { e.stopPropagation(); openPreviewAt(cur) } })
|
||||
// 下载浮层:与图库共用同一组 hover token;组件缺失时退回旧的双小按钮(单文件/旧加载顺序)
|
||||
|
||||
Reference in new issue
Block a user