diff --git a/public/opac/js/calendrier.js b/public/opac/js/calendrier.js index c5fc20a230402c0b643ad3965e03350cbe17c94c..e748f64089a67431408e67841f6d678b6e63b9ae 100644 --- a/public/opac/js/calendrier.js +++ b/public/opac/js/calendrier.js @@ -1,8 +1,14 @@ var ajaxify_calendars = function () { - var month_link = $("a.calendar_title_month_clickable:first-child, a.calendar_title_month_clickable:last-child, .calendar .month_list a"); + var month_link = $("a.calendar_title_month_clickable:first-child, a.calendar_title_month_clickable:last-child, .calendar .month_list a:not(.no_event)"); month_link.click(function(event) { var url = $(this).attr('href'); + + if(!url) { + event.preventDefault(); + return false; + } + if (url == '#') url = $(this).jqmData('href'); @@ -11,7 +17,12 @@ var ajaxify_calendars = function () { event.preventDefault(); }); - $('.calendar').bind('swiperight', + var month_no_event = $('.calendar .month_list a.no_event'); + month_no_event.click(function(event) { + event.preventDefault(); + }); + + $('.calendar').bind('swiperight', function () { $("a.calendar_title_month_clickable:first-child").click(); }); @@ -33,6 +44,7 @@ var ajaxify_calendars = function () { $('.auto_resize').removeClass('auto_resize'); if (undefined != window.calendrierAfterLoad) calendrierAfterLoad(); + }; $(ajaxify_calendars);