started updates on 0704
This commit is contained in:
@@ -60,15 +60,15 @@
|
||||
})()
|
||||
|
||||
// checks if body has a class
|
||||
function bodyHasClass(classname, notclassname){
|
||||
function bodyHasClass(classname, notclassname) {
|
||||
if ($('body').hasClass(classname)) {
|
||||
if (notclassname) {
|
||||
if ($('body').hasClass(notclassname)) {
|
||||
return false
|
||||
}else{
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
} else {
|
||||
@@ -80,7 +80,7 @@
|
||||
const isHome = bodyHasClass('home')
|
||||
|
||||
//isArchive
|
||||
const isArchive = bodyHasClass('archive','category-esemeny')
|
||||
const isArchive = bodyHasClass('archive', 'category-esemeny')
|
||||
|
||||
//isEsemeny
|
||||
const isEsemeny = bodyHasClass('category-esemeny')
|
||||
@@ -435,6 +435,22 @@
|
||||
currElem = homeScroll(currElem, "next")
|
||||
})
|
||||
|
||||
/* --------------------------- scroll on keyboard --------------------------- */
|
||||
$('html').keydown(function () {
|
||||
if (!isMobile) {
|
||||
if (isHome || isArchive) {
|
||||
//right:
|
||||
if (event.which == 39) {
|
||||
event.preventDefault();
|
||||
currElem = homeScroll(currElem, "next")
|
||||
// left:
|
||||
} else if (event.which == 37){
|
||||
currElem = homeScroll(currElem, "prev")
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
/* -------------------------- loadmore: ajax loads -------------------------- */
|
||||
|
||||
$('.misha_loadmore').on("moreload-start", function () {
|
||||
@@ -694,34 +710,34 @@
|
||||
/* SINGLE */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
|
||||
if (isSingle) {
|
||||
|
||||
/* -------------------------------- Lightbox -------------------------------- */
|
||||
|
||||
|
||||
|
||||
|
||||
//group gallery images:
|
||||
$('.wp-block-gallery a, .wp-block-image a').addClass('cb-gallery')
|
||||
|
||||
//copy figcaption to title
|
||||
$("a.cb-gallery ~ figcaption").each(function(){
|
||||
$("a.cb-gallery ~ figcaption").each(function () {
|
||||
let captiotext = $(this).html()
|
||||
$(this).prev('.cb-gallery').attr({title:captiotext})
|
||||
$(this).prev('.cb-gallery').attr({ title: captiotext })
|
||||
})
|
||||
|
||||
//http://www.jacklmoore.com/colorbox/
|
||||
const colorboxSettings = {
|
||||
transition:'fade',
|
||||
rel:'cb-ballery',
|
||||
transition: 'fade',
|
||||
rel: 'cb-ballery',
|
||||
maxWidth: '90%',
|
||||
maxHeight: '80%',
|
||||
trapFocus: false,
|
||||
scrolling: false,
|
||||
fixed: true,
|
||||
previous: '',
|
||||
next:'',
|
||||
close:'',
|
||||
next: '',
|
||||
close: '',
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user