MediaWiki:Common.js: Unterschied zwischen den Versionen
Keine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
| Zeile 1: | Zeile 1: | ||
/* === PREPRINT START === */ | /* === PREPRINT START === */ | ||
/* ============================================ | /* ============================================ | ||
PREPRINT v7.17 - JS | PREPRINT v7.17 - JS v260210r1 | ||
ARCHITECTURE: | ARCHITECTURE: | ||
| Zeile 804: | Zeile 804: | ||
void document.body.offsetHeight; | void document.body.offsetHeight; | ||
// Collect elements with | // Collect elements with document-relative positions | ||
var scrollY = window.pageYOffset || document.documentElement.scrollTop; | |||
var allOC = []; | var allOC = []; | ||
$('.outer-column').each(function() { | $('.outer-column').each(function() { | ||
| Zeile 814: | Zeile 815: | ||
el: $el, | el: $el, | ||
oc: $oc, | oc: $oc, | ||
top: rect.top, | top: rect.top + scrollY, | ||
bottom: rect.bottom | bottom: rect.bottom + scrollY | ||
}); | }); | ||
}); | }); | ||
}); | }); | ||
// Sort by | // Sort by document-relative top | ||
allOC.sort(function(a, b) { return a.top - b.top; }); | allOC.sort(function(a, b) { return a.top - b.top; }); | ||
// Fix overlaps using | // Fix overlaps using document-relative positions | ||
var lastBottom = 0; | var lastBottom = 0; | ||
allOC.forEach(function(item, index) { | allOC.forEach(function(item, index) { | ||
| Zeile 1.479: | Zeile 1.480: | ||
})(); | })(); | ||
/* === PREPRINT END === */ | /* === PREPRINT END === */ | ||