From a8e2d3d285d2232b4f0978505f4b7086f9039dda Mon Sep 17 00:00:00 2001 From: Michal Kutil Date: Thu, 29 Jul 2010 14:46:45 +0200 Subject: [PATCH 1/2] Active state shown. --- jquery-ui-timepicker-addon.js | 1 + 1 file changed, 1 insertion(+) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 3a106ad..1afbd2c 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -367,6 +367,7 @@ } this._notifyChange(inst); + this._updateDatepicker(inst); }; //Change 4 - reduction of code required for override for _updateDatepicker function From e426a460edb6c7edb351d4f44f740d8ad6c5f033 Mon Sep 17 00:00:00 2001 From: Michal Kutil Date: Thu, 29 Jul 2010 14:53:45 +0200 Subject: [PATCH 2/2] Less bad hack for method owerload. --- jquery-ui-timepicker-addon.js | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 1afbd2c..ed1dafe 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -340,32 +340,15 @@ //######################################################################## // the bad hack :/ override datepicker so it doesnt close on select + // inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378 //######################################################################## - $.datepicker._selectDate = function(id, dateStr) { + $.datepicker._selectDateOverload = $.datepicker._selectDate; + $.datepicker._selectDate = function (id, dateStr) { var target = $(id); var inst = this._getInst(target[0]); - var holdDatepickerOpen = (this._get(inst, 'holdDatepickerOpen') === true) ? true : false; // this line for timepicker.. - dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); - - if (inst.input) - inst.input.val(dateStr); - this._updateAlternate(inst); - var onSelect = this._get(inst, 'onSelect'); - if (onSelect) - onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback - else if (inst.input) - inst.input.trigger('change'); // fire the change event - if (inst.inline) - this._updateDatepicker(inst); - else if (holdDatepickerOpen) { } // this line for timepicker.. - else { - this._hideDatepicker(); - this._lastInput = inst.input[0]; - if (typeof (inst.input[0]) != 'object') - inst.input.focus(); // restore focus - this._lastInput = null; - } - + inst.inline = true; + $.datepicker._selectDateOverload(id, dateStr); + inst.inline = false; this._notifyChange(inst); this._updateDatepicker(inst); };