MediaWiki:Common.js: Unterschied zwischen den Versionen

Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
/* === PREPRINT START === */
/* === PREPRINT START === */
/* ============================================
/* ============================================
   PREPRINT v7.17 - JS v260212r3
   PREPRINT v7.17 - JS v260212r5
    
    
   ARCHITECTURE:
   ARCHITECTURE:
Zeile 708: Zeile 708:
         function applyPortraitProjection() {
         function applyPortraitProjection() {
             if (layout && layout[0]) layout[0].style.paddingBottom = '';
             if (layout && layout[0]) layout[0].style.paddingBottom = '';
             $('.preprint-oc-spacer').remove();
             $('.outer-column').css('min-height', '');
             // Clear inline positioning
             // Clear inline positioning
             linkage.forEach(function(link) {
             linkage.forEach(function(link) {
Zeile 967: Zeile 967:


         function syncOCtoIC() {
         function syncOCtoIC() {
             // Remove existing spacers
             // Set min-height on each OC so grid row accommodates its content
             $('.preprint-oc-spacer').remove();
             $('.outer-column').each(function() {
           
                 var $oc = $(this);
            if (!document.body.classList.contains('preprint-landscape')) return;
                 if (!document.body.classList.contains('preprint-landscape')) {
           
                     $oc.css('min-height', '');
            // For each linkage, check if OC content extends below next IC content
                     return;
            var scrollY = window.pageYOffset || document.documentElement.scrollTop;
           
            linkage.forEach(function(link) {
                 var markerEl = link.marker[0];
               
                // Find next IC sibling after marker (skip other markers)
                var next = markerEl.nextElementSibling;
                 while (next && next.classList.contains('oc-marker')) {
                     next = next.nextElementSibling;
                }
                if (!next) return;
               
                // Get OC element bottom (document-relative)
                var ocRect = link.element[0].getBoundingClientRect();
                var ocBottom = ocRect.top + scrollY + ocRect.height;
               
                // Get next IC element top (document-relative)
                var icRect = next.getBoundingClientRect();
                var icTop = icRect.top + scrollY;
               
                // If OC extends below next IC content, insert spacer
                var overflow = ocBottom - icTop;
                if (overflow > 4) {
                    var spacer = document.createElement('div');
                     spacer.className = 'preprint-oc-spacer';
                    spacer.style.height = overflow + 'px';
                    markerEl.parentNode.insertBefore(spacer, next);
                 }
                 }
                var maxBottom = 0;
                $oc.children('.place-oc, .place-lh, .preprint-table-oc-wrapper').each(function() {
                    var top = parseFloat($(this).css('top')) || 0;
                    var height = $(this).outerHeight(true);
                    var bottom = top + height;
                    if (bottom > maxBottom) maxBottom = bottom;
                });
                $oc.css('min-height', maxBottom > 0 ? maxBottom + 'px' : '');
             });
             });
         }
         }
Zeile 1.651: Zeile 1.632:


})();
})();


/* === PREPRINT END === */
/* === PREPRINT END === */