fix(out): 加载/失败态改用父容器打类(去 :has 依赖);破图显示「加载失败」
This commit is contained in:
1 parent
c20834b623
commit
37fe86c88c
3 files changed
+12
-4
No files matched your search
@@ -899,7 +899,7 @@
|
||||
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 { if (e && e.currentTarget) e.currentTarget.classList.add('is-loaded') } 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) => { 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 () {
|
||||
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,6 +915,7 @@
|
||||
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')
|
||||
} 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;组件缺失时退回旧的双小按钮(单文件/旧加载顺序)
|
||||
@@ -935,6 +936,7 @@
|
||||
: null)
|
||||
return el('div', { key: String(r.url || '') + '|' + ri, className: 'iwb-out-cell' },
|
||||
phEl,
|
||||
el('span', { className: 'iwb-out-cell-err', key: 'err' }, '加载失败'),
|
||||
ingBadge,
|
||||
DlOv ? el(DlOv, { key: 'ov', onDownload: doDownload, icon: I('download'), label: '下载' }, imgEl) : imgEl,
|
||||
el('div', { className: 'iwb-out-cell-meta' }, (r.width || '?') + '×' + (r.height || '?')),
|
||||
|
||||
Reference in new issue
Block a user