summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/docs/options.html3
-rw-r--r--src/jquery-ui-timepicker-addon.js16
2 files changed, 18 insertions, 1 deletions
diff --git a/src/docs/options.html b/src/docs/options.html
index d1b1e2c..0754fb0 100644
--- a/src/docs/options.html
+++ b/src/docs/options.html
@@ -209,6 +209,9 @@
<dt>timeOnlyShowDate</dt>
<dd><em>Default: false</em> - Show the date and time in the input, but only allow the timepicker.</dd>
+ <dt>afterInject</dt>
+ <dd><em>Default: null</em> - Function to be called when the timepicker or selection control is injected or re-rendered. Called in the context of the timepicker instance.</dd>
+
<dt>onSelect</dt>
<dd><em>Default: null</em> - Function to be called when a date is chosen or time has changed (parameters: datetimeText, datepickerInstance).</dd>
diff --git a/src/jquery-ui-timepicker-addon.js b/src/jquery-ui-timepicker-addon.js
index a92d277..e701194 100644
--- a/src/jquery-ui-timepicker-addon.js
+++ b/src/jquery-ui-timepicker-addon.js
@@ -109,7 +109,8 @@
controlType: 'slider',
oneLine: false,
defaultValue: null,
- parse: 'strict'
+ parse: 'strict',
+ afterInject: null
};
$.extend(this._defaults, this.regional['']);
};
@@ -319,6 +320,7 @@
this.timeDefined = this._parseTime(currDT);
this._limitMinMaxDateTime(dp_inst, false);
this._injectTimePicker();
+ this._afterInject();
},
/*
@@ -356,6 +358,16 @@
},
/*
+ * Handle callback option after injecting timepicker
+ */
+ _afterInject: function() {
+ var o = this.inst.settings;
+ if ($.isFunction(o.afterInject)) {
+ o.afterInject.call(this);
+ }
+ },
+
+ /*
* generate and inject html for timepicker into ui datepicker
*/
_injectTimePicker: function () {
@@ -500,6 +512,7 @@
this.timezone_select.change(function () {
tp_inst._onTimeChange();
tp_inst._onSelectHandler();
+ tp_inst._afterInject();
});
// End timezone options
@@ -1058,6 +1071,7 @@
$(sel).appendTo(obj).change(function (e) {
tp_inst._onTimeChange();
tp_inst._onSelectHandler();
+ tp_inst._afterInject();
});
return obj;