This commit is contained in:
2020-07-20 16:10:11 +02:00
parent 89d3753b74
commit f9645ccd61
3 changed files with 25 additions and 6 deletions
@@ -38,6 +38,8 @@
if(_is_mobile){
initMobile();
}else if(drupalSettings.path.isFront){
initDesktopHome();
}
initEvents();
@@ -179,6 +181,19 @@
// .parents('.taxonomy-term.vocabulary-entrees.home_mobile').toggleClass(part+'-opened');
// }
function initDesktopHome(){
console.log('initDesktopHome');
// allow multiple prods on home but display only one randomly
var $prods = $('.grid .col .node--type-page');
$r = Math.floor(Math.random() * $prods.length)
$prods.each(function(index) {
if(index != $r){
$(this).parents('.col').remove();
}
});
console.log('$prods', $prods);
}
// ___ _
// | __|_ _____ _ _| |_ ___
// | _|\ V / -_) ' \ _(_-<