Compare commits
No commits in common. "1e408d9b25490b9e848d43df6ebeeac4b6f703af" and "b0d3281149c2282b9829c750bb38425878b184ca" have entirely different histories.
1e408d9b25
...
b0d3281149
3 changed files with 18 additions and 15 deletions
|
@ -79,18 +79,6 @@ function loadGallery(images, idx) {
|
||||||
const thumbnailsContainer = gallery.querySelector(".thumbnails");
|
const thumbnailsContainer = gallery.querySelector(".thumbnails");
|
||||||
const download = gallery.querySelector(".download");
|
const download = gallery.querySelector(".download");
|
||||||
|
|
||||||
gallery.addEventListener("keydown", event => {
|
|
||||||
if (event.keyCode == 39) {
|
|
||||||
event.preventDefault()
|
|
||||||
event.stopPropagation()
|
|
||||||
nextBtn.onclick(event)
|
|
||||||
} else if (event.keyCode == 37) {
|
|
||||||
event.preventDefault()
|
|
||||||
event.stopPropagation()
|
|
||||||
prevBtn.onclick(event)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
function updateGallery(index) {
|
function updateGallery(index) {
|
||||||
mainImage.src = images[index].src.replace('_display', '_thumbnail');
|
mainImage.src = images[index].src.replace('_display', '_thumbnail');
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
|
@ -34,15 +34,30 @@ document.querySelectorAll('.select-image').forEach(function(a) {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (document.querySelectorAll('.select-image').length && document.location.hash.length) {
|
||||||
|
var slide = parseInt(document.location.hash.slice(1))
|
||||||
|
if (slide) {
|
||||||
|
slider.goToSlide(slide - 1)
|
||||||
|
slider.resize()
|
||||||
|
slider.redrawSlider()
|
||||||
|
setTimeout(function() {
|
||||||
|
slider.resize()
|
||||||
|
slider.redrawSlider()
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
$(document).keydown(function(e){
|
$(document).keydown(function(e){
|
||||||
if (e.keyCode == 39) // Right arrow
|
if (e.keyCode == 39) // Right arrow
|
||||||
{
|
{
|
||||||
slider && slider.goToNextSlide && slider.goToNextSlide();
|
slider && slider.goToNextSlide();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (e.keyCode == 37) // left arrow
|
else if (e.keyCode == 37) // left arrow
|
||||||
{
|
{
|
||||||
slider && slider.goToPrevSlide && slider.goToPrevSlide();
|
slider && slider.goToPrevSlide();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -200,7 +200,7 @@ class Content(models.Model):
|
||||||
if self.photo and self.photo.image.url.endswith('.gif'):
|
if self.photo and self.photo.image.url.endswith('.gif'):
|
||||||
video_path = self.photo.image.path.replace('.gif', '.mp4')
|
video_path = self.photo.image.path.replace('.gif', '.mp4')
|
||||||
image_path = self.photo.image.path.replace('.gif', '.jpg')
|
image_path = self.photo.image.path.replace('.gif', '.jpg')
|
||||||
if os.path.exists(self.photo.image.path) and not os.path.exists(video_path):
|
if not os.path.exists(video_path):
|
||||||
height = self.photo.image.height
|
height = self.photo.image.height
|
||||||
if height % 2:
|
if height % 2:
|
||||||
height += 1
|
height += 1
|
||||||
|
|
Loading…
Add table
Reference in a new issue