MediaWiki:Gadget-figureSource.js: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 336:
}
function renderCrop(container, entry, pdf
if (!entry.rect) { return; }
pdf.page(entry.page).then(function (pg) {
var s = pg.viewport.scale;
var x0 = Math.max(0, (entry.rect[0] - CROP_MARGIN_X) * s);
Line 372 ⟶ 371:
}
function onAway(e) {
// clicks INSIDE the surface never dismiss it — the open link
// must be clickable on both surfaces
if (!cueOf(e)) { close(); }
}
Line 404 ⟶ 406:
}, false);
} else {
//
// UI, which the user preferred over a hover peek (and which the
document.addEventListener('mouseover', function (e) {▼
// touch banner mirrors). The card carries the open link, so
// unlike the footnote hover popover it is interactive.
var cue = cueOf(e);
if (!cue
close();
activeCue = cue;
Line 413 ⟶ 421:
box = document.createElement('div');
box.className = 'fig-card';
box.innerHTML = peekHtml(cue, entry,
document.body.appendChild(box);
// page like the
setTimeout(function ()
▲ close();
▲ }, true);
▲ document.addEventListener('click', function (e) {
▲ var cue = cueOf(e);
▲ if (!cue) { return; }
▲ if (!entry.id) { return; }
});
}
Line 557 ⟶ 544:
// --text-dark because body-attached elements inherit the SKIN's
// #202122, not the content area's ink.
// absolute (page coords) so it scrolls with the page like the
'.fig-card{position:fixed;z-index:2147483647;' +▼
// original popover; interactive because it carries the open link
'max-width:min(420px,90vw);background:#fff;padding:0;' +
'border:1px solid #0d0d0d;color:var(--text-dark,#0d0d0d);' +
'box-shadow:0 4px 16px rgba(43,41,38,.18);pointer-events:
// full-bleed crop in both surfaces (declare border/margin — an
// omitted property lets a stale stacked stylesheet rule survive)
| |||