Skip to content

Commit 60ffceb

Browse files
Fix for altField option when using inline picker
1 parent c1d7c5a commit 60ffceb

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

jquery-ui-timepicker-addon.js

+6-7
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,7 @@ $.extend(Timepicker.prototype, {
125125
}
126126
}
127127
tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, o, {
128-
beforeShow: function(input, dp_inst) {
129-
if (o.altField)
130-
tp_inst.$altInput = $($.datepicker._get(dp_inst, 'altField'))
131-
.css({ cursor: 'pointer' })
132-
.focus(function(){
133-
$input.trigger("focus");
134-
});
128+
beforeShow: function(input, dp_inst) {
135129
if ($.isFunction(o.beforeShow))
136130
o.beforeShow(input, dp_inst);
137131
},
@@ -150,6 +144,11 @@ $.extend(Timepicker.prototype, {
150144
timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
151145
});
152146

147+
if (o.altField)
148+
tp_inst.$altInput = $(o.altField)
149+
.css({ cursor: 'pointer' })
150+
.focus(function(){ $input.trigger("focus"); });
151+
153152
// datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
154153
if(tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date)
155154
tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());

0 commit comments

Comments
 (0)