1var alerteInfo = { 2 init: function () { 3 alerteInfo.initAlerteCrise(); 4 alerteInfo.initAlerteBandeau(); 5 }, 6 initAlerteCrise: function () { 7 var divInfoAlert = $('#alerteCrisePopin'); 8 if (divInfoAlert.length !== 0) { 9 var btnToggleAlert = $('.alertePicto'); 10 btnToggleAlert.on('click', function (e) { 11 e.stopImmediatePropagation(); 12 if (!divInfoAlert.hasClass('open')) { 13 divInfoAlert.addClass('open').removeAttr('aria-hidden'); 14 btnToggleAlert.toggleClass('open closed'); 15 16 // piège à focus 17 $('#closeAlertePopin').focus(); 18 } else { 19 divInfoAlert.removeClass('open').attr('aria-hidden', 'true'); 20 btnToggleAlert.toggleClass('open closed'); 21 $.cookie("ALERTEINFO", 2); 22 } 23 }); 24 25 //Fermer l'alerte 26 $(window).on('click', function (e) { 27 if (e.target === $('.modal')[0]) { 28 closeModal(); 29 } 30 }); 31 32 $('#closeAlertePopin').click(function () { 33 closeModal(); 34 }); 35 36 function closeModal() { 37 btnToggleAlert.toggleClass('open closed').focus(); 38 divInfoAlert.removeClass('open').attr('aria-hidden', 'true'); 39 $.cookie("ALERTEINFO", 2); 40 } 41 } 42 }, 43 initAlerteBandeau: function () { 44 var divInfoAlert = $('#alerteCriseBandeau'); 45 if (divInfoAlert.length !== 0) { 46 var btnToggleAlert = $('.alertePicto, #closeAlerteBandeau'); 47 btnToggleAlert.on('click', function (e) { 48 e.preventDefault(); 49 if (!divInfoAlert.hasClass('open')) { 50 divInfoAlert.slideToggle(300).toggleClass('open').removeAttr('aria-hidden'); 51 btnToggleAlert.toggleClass('open closed'); 52 $('#closeAlertePopin').focus(); 53 } else { 54 divInfoAlert.slideUp(300).removeClass('open').attr('aria-hidden', 'true'); 55 btnToggleAlert.toggleClass('open closed'); 56 $.cookie("ALERTEINFO", 2); 57 } 58 }); 59 } 60 }, 61}; 62 63$(document).ready(alerteInfo.init);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.