|
340 | 340 |
|
341 | 341 | //########################################################################
|
342 | 342 | // the bad hack :/ override datepicker so it doesnt close on select
|
| 343 | + // inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378 |
343 | 344 | //########################################################################
|
344 |
| - $.datepicker._selectDate = function(id, dateStr) { |
| 345 | + $.datepicker._selectDateOverload = $.datepicker._selectDate; |
| 346 | + $.datepicker._selectDate = function (id, dateStr) { |
345 | 347 | var target = $(id);
|
346 | 348 | var inst = this._getInst(target[0]);
|
347 |
| - var holdDatepickerOpen = (this._get(inst, 'holdDatepickerOpen') === true) ? true : false; // this line for timepicker.. |
348 |
| - dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); |
349 |
| - |
350 |
| - if (inst.input) |
351 |
| - inst.input.val(dateStr); |
352 |
| - this._updateAlternate(inst); |
353 |
| - var onSelect = this._get(inst, 'onSelect'); |
354 |
| - if (onSelect) |
355 |
| - onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback |
356 |
| - else if (inst.input) |
357 |
| - inst.input.trigger('change'); // fire the change event |
358 |
| - if (inst.inline) |
359 |
| - this._updateDatepicker(inst); |
360 |
| - else if (holdDatepickerOpen) { } // this line for timepicker.. |
361 |
| - else { |
362 |
| - this._hideDatepicker(); |
363 |
| - this._lastInput = inst.input[0]; |
364 |
| - if (typeof (inst.input[0]) != 'object') |
365 |
| - inst.input.focus(); // restore focus |
366 |
| - this._lastInput = null; |
367 |
| - } |
368 |
| - |
| 349 | + inst.inline = true; |
| 350 | + $.datepicker._selectDateOverload(id, dateStr); |
| 351 | + inst.inline = false; |
369 | 352 | this._notifyChange(inst);
|
370 | 353 | this._updateDatepicker(inst);
|
371 | 354 | };
|
|
0 commit comments