Skip to content
Snippets Groups Projects
Commit 888eda51 authored by llaffont's avatar llaffont
Browse files

Calendrier liste mois se charge en ajax

parent 31786f4a
Branches
Tags
No related merge requests found
......@@ -4488,6 +4488,7 @@ public/opac/js/accessibility.js -text
public/opac/js/avis.js -text
public/opac/js/babeltheque.js -text
public/opac/js/bib.js -text
public/opac/js/calendrier.js -text
public/opac/js/division-five.js -text
public/opac/js/imageMenu.js -text
public/opac/js/jquery.placeholder.min.js -text
......
......@@ -25,44 +25,7 @@ class ZendAfi_View_Helper_Accueil_Calendar extends ZendAfi_View_Helper_Accueil_B
protected $class_calendar;
protected function _renderHeadScriptsOn($script_loader) {
$script_loader->addJQueryReady($this->_getAjaxCalendarScript());
}
protected function _getAjaxCalendarScript() {
return <<<SCRIPT
var ajaxify_calendars = function () {
var month_link = $("a.calendar_title_month_clickable:first-child, a.calendar_title_month_clickable:last-child");
month_link.click(function(event) {
var url = $(this).attr('href');
if (url == '#')
url = $(this).jqmData('href');
$(this).closest(".calendar").load(url+'/render/ajax',
ajaxify_calendars);
event.preventDefault();
});
$('.calendar').bind('swiperight',
function () {
$("a.calendar_title_month_clickable:first-child").click();
});
$('.calendar').bind('swipeleft',
function () {
$("a.calendar_title_month_clickable:last-child").click();
});
$("form#calendar_select_categorie").change(function(event) {
var url = $(this).attr('action');
$(this).parents(".calendar").load(url,
{'select_id_categorie':$(this).children('select').val(),
'id_module':$(this).children('input').val()},
ajaxify_calendars);
});
};
ajaxify_calendars();
SCRIPT;
$script_loader->addOPACScript('calendrier');
}
......
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");
month_link.click(function(event) {
var url = $(this).attr('href');
if (url == '#')
url = $(this).jqmData('href');
$(this).closest(".calendar").load(url+'/render/ajax',
ajaxify_calendars);
event.preventDefault();
});
$('.calendar').bind('swiperight',
function () {
$("a.calendar_title_month_clickable:first-child").click();
});
$('.calendar').bind('swipeleft',
function () {
$("a.calendar_title_month_clickable:last-child").click();
});
$("form#calendar_select_categorie").change(function(event) {
var url = $(this).attr('action');
$(this).parents(".calendar").load(url,
{'select_id_categorie':$(this).children('select').val(),
'id_module':$(this).children('input').val()},
ajaxify_calendars);
});
};
$(ajaxify_calendars);
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment