aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authormarcneuwirth <marc.neuwirth@gmail.com>2011-06-28 10:49:47 -0500
committerCorey Frang <gnarf@gnarf.net>2011-06-28 10:49:47 -0500
commita56aa861b1deb6d71ec74a77647d12d50570ea57 (patch)
treee391c32f496b05f3f10734e900a9574ae3acc75e /ui
parent5c34cea06fb84777e1af72acf5ff0e9b60bd96f2 (diff)
downloadjquery-ui-a56aa861b1deb6d71ec74a77647d12d50570ea57.tar.gz
jquery-ui-a56aa861b1deb6d71ec74a77647d12d50570ea57.zip
Datepicker: Added onSelect.apply() call to _doKeyDown method when enter button pushed if onSelect is defined. Fixed #7124 - Datepicker: onSelect does not fire when enter button is pushed
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.datepicker.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index 1d3de7740..442621e0d 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -529,6 +529,13 @@ $.extend(Datepicker.prototype, {
$.datepicker._currentClass + ')', inst.dpDiv);
if (sel[0])
$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
+ var onSelect = $.datepicker._get(inst, 'onSelect');
+ if (onSelect) {
+ var dateStr = $.datepicker._formatDate(inst);
+
+ // trigger custom callback
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
+ }
else
$.datepicker._hideDatepicker();
return false; // don't submit the form