fix: card pictures load reliably, and the queue button fits its column
A picture had no size until it loaded, and a lazy image with no size may never be loaded, so some cards showed the layout drawing instead. Pictures now take their whole box from the start (object-fit keeps the look). A picture dropped by a re-render while loading no longer counts as missing, which removed it from every later render until a reload. "Baixar todos" spilled out of the Fila de impressão header at 1440 px; it is "Baixar" now, with the full description in its tooltip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 54 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 59 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB |
@@ -280,7 +280,8 @@ a.zap{display:inline-flex;align-items:center;gap:4px;vertical-align:bottom}
|
||||
what is transparent; without a picture, the layout drawing stands in. */
|
||||
.art{position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;flex-shrink:0;border-radius:8px;border:1px solid var(--line2);
|
||||
background-color:#2A2F35;background-image:conic-gradient(#323840 25%,transparent 0 50%,#323840 0 75%,transparent 0);background-size:12px 12px}
|
||||
.art img{display:block;max-width:100%;max-height:100%;object-fit:contain}
|
||||
/* The whole box from the start: a lazy image with no size yet may never be loaded. */
|
||||
.art img{display:block;width:100%;height:100%;object-fit:contain}
|
||||
.art.layout{background:var(--card2);padding:4px}
|
||||
.art.layout svg{display:block;height:100%;width:auto;max-width:100%}
|
||||
.art.none{background:var(--card2)}
|
||||
@@ -297,7 +298,7 @@ a.zap{display:inline-flex;align-items:center;gap:4px;vertical-align:bottom}
|
||||
.pane .preview .view{height:300px}
|
||||
.preview .view.art{padding:6px;border:1px solid var(--line2);
|
||||
background-color:#2A2F35;background-image:conic-gradient(#323840 25%,transparent 0 50%,#323840 0 75%,transparent 0);background-size:14px 14px}
|
||||
.preview .view.art img{flex:1;min-width:0;max-height:100%;object-fit:contain}
|
||||
.preview .view.art img{flex:1;min-width:0;height:100%;object-fit:contain}
|
||||
.preview .view.layout{padding:6px;background:var(--bg)}
|
||||
.item .preview .view.layout svg{height:100%;width:auto;max-width:100%}
|
||||
|
||||
|
||||
@@ -200,7 +200,8 @@ function manifest(production){
|
||||
function artPicture(uid,alt=''){
|
||||
if(!uid||!THUMBS.has(String(uid)))return null;
|
||||
const img=node('img');img.src='/api/operator/uploads/'+uid+'/thumbnail';img.alt=alt;img.loading='lazy';img.decoding='async';
|
||||
img.onerror=()=>{THUMBS.delete(String(uid));img.remove();};
|
||||
// Only a picture still on screen gives up: one dropped by a re-render mid-load is not missing.
|
||||
img.onerror=()=>{if(!img.isConnected)return;THUMBS.delete(String(uid));img.remove();};
|
||||
return img;
|
||||
}
|
||||
// A small box with the first picture of these items; without one, the layout
|
||||
@@ -333,7 +334,7 @@ function renderBoard(){
|
||||
const sub=node('div',undefined,'col-sub');sub.append(node('small',orders.length?metres(total)+' no total':'vazio'));
|
||||
// The print queue's files, all at once, to import into FlexiPRINT.
|
||||
if(state==='fil'&&orders.length){
|
||||
const all=downloadButton('Baixar todos',downloadQueue,'btn ghost small');all.title='Baixar os arquivos finais de todos os pedidos da fila';
|
||||
const all=downloadButton('Baixar',downloadQueue,'btn ghost small');all.title='Baixar os arquivos finais de todos os pedidos da fila';
|
||||
sub.append(all);
|
||||
}
|
||||
head.append(line,sub);
|
||||
|
||||
Reference in New Issue
Block a user