summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--index.html2
-rw-r--r--jquery-ui-timepicker-addon.js8
2 files changed, 6 insertions, 4 deletions
diff --git a/index.html b/index.html
index 3bf898f..264d3c3 100644
--- a/index.html
+++ b/index.html
@@ -605,7 +605,7 @@ $('#slider_example_3').datetimepicker({
<!-- ============= example -->
<div class="example-container">
- <p>Use dropdowns instead of sliders</p>
+ <p>Use dropdowns instead of sliders. By default if slider is not available dropdowns will be used.</p>
<div>
<input type="text" name="slider_example_4" id="slider_example_4" value="" />
</div>
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js
index 1511553..5fb7898 100644
--- a/jquery-ui-timepicker-addon.js
+++ b/jquery-ui-timepicker-addon.js
@@ -834,8 +834,10 @@
/*
* Small abstraction to control types
+ * We can add more, just be sure to follow the pattern: create, options, value
*/
_controls: {
+ // slider methods
slider: {
create: function(tp_inst, obj, unit, val, min, max, step){
return obj.prop('slide', null).slider({
@@ -864,6 +866,7 @@
return obj.slider('value');
}
},
+ // select methods
select: {
create: function(tp_inst, obj, unit, val, min, max, step){
var sel = '<select class="ui-timepicker-select" data-unit="'+ unit +'" data-min="'+ min +'" data-max="'+ max +'" data-step="'+ step +'">',
@@ -894,8 +897,7 @@
},
options: function(tp_inst, obj, opts, val){
var o = {},
- $t = obj.find('select');
-
+ $t = obj.children('select');
if(typeof(opts) == 'string'){
if(val == undefined)
return $t.data(opts);
@@ -911,7 +913,7 @@
return $t.val();
}
}
- }
+ } // end _controls
});