2019-05-27 17:03:03 +02:00

2 lines
2.0 KiB
JavaScript

function map(){if($("#carte").length){var e=L.map("carte").setView([44.7365818,4.9776488],13),t=L.icon({iconUrl:"/user/themes/lecampus/images/mappoint.svg",iconSize:[38,95],iconAnchor:[22,94],popupAnchor:[-3,-76]});L.tileLayer("https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw",{maxZoom:18,id:"mapbox.streets"}).addTo(e),L.marker([44.7365818,4.9776488],{icon:t}).addTo(e).bindPopup("<b>Hello world!</b><br />I am le campus.").openPopup(),e.on("click",function(t){popup.setLatLng(t.latlng).setContent("You clicked the map at "+t.latlng.toString()).openOn(e)})}}function filteritem(){$(".body-wrapper > .card"),$(".cat a"),$(".body-wrapper .img");$(".filters .btn").click(function(e){e.preventDefault();var t=$(this).attr("data-filter");$(".body-wrapper").masonryFilter({filter:function(){return!t||$(this).attr("data-filter")==t}})});var e=$("#archive .body-wrapper, #calendrier .body-wrapper").masonry({itemSelector:".card",gutter:10,transitionDuration:"0.2s"});e.imagesLoaded().progress(function(){e.masonry()})}function slide(){$(".gal").bxSlider({infiniteLoop:!0,preloadImages:"visible",pager:!1,auto:!0})}function links(){var e=$('li a[href="/organisez-vos-evenements"],li a[href="/qui-sommes-nous"] '),t=$("a#carte");e.on("click",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault()})}function clickbutton(){$("#ajax-test-form .radio").on("click",function(){$(this).parent(".form-data").find(".check").removeClass("check"),$(this).addClass("check")})}function clicksenddevis(){var e=$(".ok");$("#send-valide");e.on("click",function(){$(this).parent("#send-valide").remove()})}function addclass(){$("a#carte").parents(".content_s").addClass("map");var e=$("#reco .title"),t=$("#reco .txt");e.on("click",function(){t.toggleClass("open"),$(this).toggleClass("open")})}jQuery(document).ready(function(){addclass(),clickbutton(),links(),slide(),filteritem(),map()});