Skip to content

Commit 1a2a371

Browse files
set function scope of this; pull request by janhartigan
1 parent 960b775 commit 1a2a371

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ $.extend(Timepicker.prototype, {
140140
// Update the time as well : this prevents the time from disappearing from the $input field.
141141
tp_inst._updateDateTime(dp_inst);
142142
if ($.isFunction(o.onChangeMonthYear))
143-
o.onChangeMonthYear(year, month, dp_inst, tp_inst);
143+
o.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
144144
},
145145
onClose: function(dateText, dp_inst) {
146146
if (tp_inst.timeDefined === true && $input.val() != '')
147147
tp_inst._updateDateTime(dp_inst);
148148
if ($.isFunction(o.onClose))
149-
o.onClose(dateText, dp_inst, tp_inst);
149+
o.onClose.call($input[0], dateText, dp_inst, tp_inst);
150150
},
151151
timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
152152
});

0 commit comments

Comments
 (0)