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 v260212r7 | ||
ARCHITECTURE: | ARCHITECTURE: | ||
| Zeile 967: | Zeile 967: | ||
function syncOCtoIC() { | function syncOCtoIC() { | ||
$('.preprint-oc-spacer').remove(); | $('.preprint-oc-spacer').remove(); | ||
| Zeile 973: | Zeile 972: | ||
var scrollY = window.pageYOffset || document.documentElement.scrollTop; | var scrollY = window.pageYOffset || document.documentElement.scrollTop; | ||
// Collect ALL OC elements globally | |||
var ocElements = []; | |||
$('.outer-column').children('.place-oc, .place-lh, .preprint-table-oc-wrapper').each(function() { | |||
var rect = this.getBoundingClientRect(); | |||
ocElements.push({ | |||
top: rect.top + scrollY, | |||
bottom: rect.bottom + scrollY | |||
}); | |||
}); | |||
if (ocElements.length === 0) return; | |||
$('.inner-column').each(function() { | $('.inner-column').each(function() { | ||
var $ic = $(this); | var $ic = $(this); | ||
var icWidth = $ic[0].getBoundingClientRect().width; | var icWidth = $ic[0].getBoundingClientRect().width; | ||
$ic.children().each(function() { | $ic.children().each(function() { | ||
if (this.classList.contains('oc-marker')) return; | if (this.classList.contains('oc-marker')) return; | ||
| Zeile 999: | Zeile 995: | ||
if (elWidth <= icWidth + 1) return; | if (elWidth <= icWidth + 1) return; | ||
var rect = this.getBoundingClientRect(); | var rect = this.getBoundingClientRect(); | ||
var elTop = rect.top + scrollY; | var elTop = rect.top + scrollY; | ||
| Zeile 1.671: | Zeile 1.666: | ||
})(); | })(); | ||
/* === PREPRINT END === */ | /* === PREPRINT END === */ | ||