header fix

This commit is contained in:
2020-07-27 12:39:59 +02:00
parent e9761aa6ca
commit 34741c345d
31 changed files with 605 additions and 267 deletions
+100 -8
View File
@@ -54,12 +54,58 @@
}
function slide() {
var $slide = $('main .__slide');
var $slide = $('main section .__slide');
var thumbnails = $('.__slide article.programme.is-selected');
var $head_date = $('#block-views-block-slide-programme-block-1 section.first:before');
$slide.each(function() {
$(this).flickity({
cellAlign: 'left',
pageDots: false,
contain: true
contain: true,
on: {
ready: function() {
var dates = {},
date;
var $cells = this.cells;
// console.log('$cells',$cells);
$('.__slide article.programme[data-date]').each(function(i, el){
date = $(el).data('date');
if (dates.hasOwnProperty(date)) {
dates[date] += 1;
$(this).addClass('last');
}
else {
dates[date] = 1;
$(this).addClass('first');
var dateValue = $(this).data('date');
console.log('dateValue',dateValue);
// $(this).html(dateValue );
$("<span>"+dateValue+"</span>").prependTo($(this));
}
});
// var date = this.cells.element.dataset.date;
// var date = this.cells;
// for (var i = 0; i < date.length; i++) {
// console.log("cc",date[i].element.dataset.date);
// $head_date.append( "<div>"+date[i].element.dataset.date+"</div>" );
// }
},
// change: function(index, e) {
// var date_change = this.cells[index].element.dataset.date;
//
// if ($head_date.html() != date_change) {
// $head_date.html( "<div>"+date_change+"</div>" );
// }
//
// }
}
})
});
@@ -75,6 +121,25 @@
})
});
var $slide_paragrpahe = $('main .paragraph .__slide');
$slide_paragrpahe.each(function() {
$(this).flickity({
cellAlign: 'left',
pageDots: false,
prevNextButtons: false,
contain: true,
watchCSS: true,
})
});
// function date() {
// var thumbnails = $('.__slide article.programme');
// $.each(thumbnails, function(i){
// date = thumbnails[i].dataset.date;
// })
// }
// date();
}
function burger() {
@@ -89,12 +154,27 @@
}
function replaceAny(){
var $any_value = $('#edit-field-theme-target-id option').attr('value');
if ($any_value == "All") {
var $any_content = $('#edit-field-theme-target-id option:first-child').html();
var newhtml = $any_content.replace("- Any -", "Thèmes");
$('#edit-field-theme-target-id option:first-child').html(newhtml);
}
var $selects = $(".js-form-type-select .form-select");
$.each( $selects , function(i) {
var selectOptionAll = $(this).find("option[value='All']");
var optionContent = selectOptionAll.html();
if ($(this).attr('id') == 'edit-field-theme-target-id') {
var newhtml = optionContent.replace("- Any -", "Thèmes");
} else if ($(this).attr('id') == 'edit-field-type-de-publication-target-id' ) {
var newhtml = optionContent.replace("- Any -", "Publications");
} else {
// nothing
}
selectOptionAll.html(newhtml);
});
}
function select_custom() {
@@ -182,12 +262,24 @@
}
function remove_isactive() {
$( window ).resize(function() {
var width = $(window).width();
if (width <= '1185') {
$('header .is-active').removeClass("is-active");
$('body.is-active').removeClass("is-active");
}
});
}
$( document ).ready(function() {
notes();
slide();
burger();
replaceAny();
select_custom();
remove_isactive();
});
})(jQuery);