reintroduce lightbox, now with iFixIt steps

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK 2021-01-28 00:11:06 +01:00
parent ddd2e68785
commit 34cad980d0

View File

@ -95,11 +95,34 @@ $(document).ready(function () {
.clone() .clone()
.removeClass("step-thumb") .removeClass("step-thumb")
.addClass("step-picture") .addClass("step-picture")
.addClass("lightbox")
.insertBefore($(this).parent()); .insertBefore($(this).parent());
/* Make the first thumbnail active by default */ /* Make the first thumbnail active by default */
$(this).addClass("active"); $(this).addClass("active");
}) })
let imageGroups = []
$(".lightbox").each(function () {
let imageSource = $(this).attr('src')
let imageAlt = $(this).attr('alt').replace(/ /g,"")
let imageTitle = $(this).attr('alt')
if (imageTitle) {
imageTitle = 'title="' + imageTitle + '" '
} else {
imageTitle = ''
}
$(this).
wrap('<a class="boxedThumb ' + imageAlt + '" ' +
imageTitle + 'href="' + imageSource + '"></a>')
imageGroups.push('.' + imageAlt)
})
jQuery.unique(imageGroups)
imageGroups.forEach(imageGroupsSet)
function imageGroupsSet (value) {
$(value).simpleLightbox()
}
}) })
/* Attach a delegate function on mouse over thumbnail to change the /* Attach a delegate function on mouse over thumbnail to change the