Id images et citations #612
This commit is contained in:
+7
-3
@@ -31,8 +31,6 @@
|
||||
<!-- Page de fond -->
|
||||
<div class="column image-cover image-bleed" v-bind:style='{ backgroundImage: `url(https://popsu-rouen-en.strapi.figli.io/uploads/50424a6a43e44551a4faa699f8ef3caa.JPEG)`, }' />
|
||||
|
||||
|
||||
|
||||
<!-- Sommaire -->
|
||||
|
||||
<div class="column">
|
||||
@@ -89,6 +87,12 @@ export default {
|
||||
VueMarkdown
|
||||
},
|
||||
mounted() {
|
||||
// Ajouter
|
||||
let citations = Array.from(document.querySelectorAll("blockquote"));
|
||||
citations.forEach((c,index)=>{
|
||||
c.id = `citation-${index}`;
|
||||
});
|
||||
// Ajouter les images
|
||||
let docImages = Array.from(
|
||||
document.querySelectorAll("img")
|
||||
)
|
||||
@@ -102,12 +106,12 @@ export default {
|
||||
let img_id = img.src.split("/").pop();
|
||||
let found = imgSource.find(element => element.id == img_id);
|
||||
img.src = path.join(param.source, found.images.url);
|
||||
img.id = `${image}-${img_id}`;
|
||||
let promise = new Promise((resolve, reject) => {
|
||||
img.onload = function() {
|
||||
let legend = document.createElement("p");
|
||||
legend.classList.add("breakAfter");
|
||||
legend.classList.add("legend");
|
||||
img.parentNode.classList.add("breakBefore");
|
||||
legend.innerHTML = found.legende;
|
||||
img.parentNode.insertBefore(legend, img.nextSibling);
|
||||
resolve();
|
||||
|
||||
Reference in New Issue
Block a user