]> source.dussan.org Git - jquery-ui.git/commitdiff
Fixed #3709 - Datepicker: clicking on a date causes the browser to follow '#' anchor
authorRichard Worth <rdworth@gmail.com>
Wed, 31 Dec 2008 17:23:10 +0000 (17:23 +0000)
committerRichard Worth <rdworth@gmail.com>
Wed, 31 Dec 2008 17:23:10 +0000 (17:23 +0000)
ui/ui.datepicker.js

index 496cdada098dc627617b0eb571f3059ec2219fae..cb107f7486c859a6ea932e4cca35a5f85b7abcfd 100644 (file)
@@ -1383,7 +1383,7 @@ $.extend(Datepicker.prototype, {
                                                        ' ' + this._currentClass : '') + // highlight selected day
                                                        (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different)
                                                        ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title
-                                                       (unselectable ? '' : ' onclick="jQuery.datepicker._selectDay(\'#' +
+                                                       (unselectable ? '' : ' onclick="event.preventDefault();jQuery.datepicker._selectDay(\'#' +
                                                        inst.id + '\',' + drawMonth + ',' + drawYear + ', this);"') + '>' + // actions
                                                        (otherMonth ? (showOtherMonths ? printDate.getDate() : '&#xa0;') : // display for other months
                                                        (unselectable ? printDate.getDate() : '<a class="ui-state-default' +