Просмотр исходного кода

correction bug imgsmall_bottom

Valentin 10 месяцев назад
Родитель
Сommit
1c79c95248

+ 2 - 2
user/data/feed/3a6d0284e743dc4a9b86f97d6dd1a3bf.yaml

@@ -1,4 +1,4 @@
-last_checked: 1690072671
+last_checked: 1690208978
 data:
   -
     title: 'macOS 13.0 Ventura Apache Setup: Upgrading Homebrew'
@@ -39,7 +39,7 @@ data:
     title: 'Grav 1.7 CLI Self-Upgrade Bug'
     url: 'https://getgrav.org/blog/grav-170-cli-self-upgrade-bug'
     date: 1611222900
-    nicetime: '2 years ago'
+    nicetime: '3 years ago'
   -
     title: 'Grav 1.7 Released!'
     url: 'https://getgrav.org/blog/grav-1.7-released'

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
user/data/flex/indexes/pages.json


+ 1 - 1
user/data/notifications/3a6d0284e743dc4a9b86f97d6dd1a3bf.yaml

@@ -1,4 +1,4 @@
-last_checked: 1690085460
+last_checked: 1690208978
 data:
   feed:
     -

+ 9 - 4
user/themes/carnet-atterrissage/js/layout.js

@@ -50,12 +50,17 @@ class setMarginTexts extends Paged.Handler {
         let bottomVignettes = document.querySelectorAll('.imgsmall_bottom'); // pour les images en bas dans les pages avec du texte
         for (let bottomVignette of bottomVignettes) {
             let pageBottom = bottomVignette.closest('.pagedjs_area').getBoundingClientRect().bottom;
-            let textBottom = bottomVignette.previousElementSibling.getBoundingClientRect().bottom;
             let vignetteSize = bottomVignette.getBoundingClientRect().height;
-            if (bottomVignette.previousElementSibling.classList.contains('labeur')) {
-                bottomVignette.style.marginTop = `${(pageBottom - textBottom) - vignetteSize}px`;
+            if (bottomVignette.previousElementSibling) {
+                let textBottom = bottomVignette.previousElementSibling.getBoundingClientRect().bottom;
+                if (bottomVignette.previousElementSibling.classList.contains('labeur')) {
+                    bottomVignette.style.marginTop = `${(pageBottom - textBottom) - vignetteSize}px`;
+                }
+                bottomVignette.style.transform = 'translateY(12px)';
+            } else {
+                let vignetteBottom = bottomVignette.getBoundingClientRect().bottom;
+                bottomVignette.style.transform = `translateY(${pageBottom - vignetteBottom}px)`;
             }
-            bottomVignette.style.transform = 'translateY(12px)';
         }
         // éléments justifiés pas nécessaires
         let justifiedSplitEl = document.querySelectorAll("[data-align-last-split-element='justify']");

Некоторые файлы не были показаны из-за большого количества измененных файлов