Works on paypal module

Fix: override jquery function gotoToday
This commit is contained in:
Regis Houssin 2011-05-25 15:59:11 +00:00
parent 9dadd7a967
commit 3ebd00e059

View File

@ -138,6 +138,9 @@ if (empty($conf->global->PAYPAL_API_USER) || empty($conf->global->PAYPAL_API_PAS
var dates = $( "#startDateStr, #endDateStr" ).datepicker({
defaultDate: "+1w",
changeMonth: true,
showButtonPanel: true,
currentText: '<?php echo $langs->trans("Now"); ?>',
closeText: '<?php echo $langs->trans("Close2"); ?>',
numberOfMonths: 3,
monthNames: tradMonths,
monthNamesShort: tradMonthsMin,
@ -154,6 +157,19 @@ if (empty($conf->global->PAYPAL_API_USER) || empty($conf->global->PAYPAL_API_PAS
dates.not( this ).datepicker( "option", option, date );
}
});
// remember the old function
var _gotoToday = jQuery.datepicker._gotoToday;
// datepicker is directly inside the jQuery object, so override that
jQuery.datepicker._gotoToday = function(a){
var target = jQuery(a);
var inst = this._getInst(target[0]);
// call the old function, so default behaviour is kept
_gotoToday.call(this, a);
// now do an additional call to _selectDate which will set the date and close
// close the datepicker (if it is not inline)
jQuery.datepicker._selectDate(a,
jQuery.datepicker._formatDate(inst,inst.selectedDay, inst.selectedMonth, inst.selectedYear));
};
$( "div.paypal_link" ).click(function() {
var id_value = $(this).attr("id");
$.jnotify("<?php echo $langs->trans('PleaseBePatient'); ?>", 1500);