Compare commits
3 commits
b0d3281149
...
1e408d9b25
Author | SHA1 | Date | |
---|---|---|---|
1e408d9b25 | |||
672bad887c | |||
f61d1e0d45 |
3 changed files with 15 additions and 18 deletions
|
@ -79,6 +79,18 @@ function loadGallery(images, idx) {
|
|||
const thumbnailsContainer = gallery.querySelector(".thumbnails");
|
||||
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) {
|
||||
mainImage.src = images[index].src.replace('_display', '_thumbnail');
|
||||
setTimeout(() => {
|
||||
|
|
|
@ -34,30 +34,15 @@ 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){
|
||||
if (e.keyCode == 39) // Right arrow
|
||||
{
|
||||
slider && slider.goToNextSlide();
|
||||
slider && slider.goToNextSlide && slider.goToNextSlide();
|
||||
return false;
|
||||
}
|
||||
else if (e.keyCode == 37) // left arrow
|
||||
{
|
||||
slider && slider.goToPrevSlide();
|
||||
slider && slider.goToPrevSlide && slider.goToPrevSlide();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -200,7 +200,7 @@ class Content(models.Model):
|
|||
if self.photo and self.photo.image.url.endswith('.gif'):
|
||||
video_path = self.photo.image.path.replace('.gif', '.mp4')
|
||||
image_path = self.photo.image.path.replace('.gif', '.jpg')
|
||||
if not os.path.exists(video_path):
|
||||
if os.path.exists(self.photo.image.path) and not os.path.exists(video_path):
|
||||
height = self.photo.image.height
|
||||
if height % 2:
|
||||
height += 1
|
||||
|
|
Loading…
Add table
Reference in a new issue