summaryrefslogtreecommitdiffstats
path: root/jquery-ui-timepicker-addon.js
diff options
context:
space:
mode:
authorTrent Richardson <trentdrichardson@gmail.com>2012-10-04 10:16:11 -0400
committerTrent Richardson <trentdrichardson@gmail.com>2012-10-04 10:16:11 -0400
commitf547fa4c87c5ed3ba71cf04bcc11fee1e8ca1c24 (patch)
tree6c3ed6279bf62f1d1a32a7253281dd48acf3127b /jquery-ui-timepicker-addon.js
parent6e0c31ae904850c908797d2d2e807646cd830a79 (diff)
downloadjQuery-Timepicker-Addon-f547fa4c87c5ed3ba71cf04bcc11fee1e8ca1c24.zip
jQuery-Timepicker-Addon-f547fa4c87c5ed3ba71cf04bcc11fee1e8ca1c24.tar.gz
jQuery-Timepicker-Addon-f547fa4c87c5ed3ba71cf04bcc11fee1e8ca1c24.tar.bz2
Control updates - can pass object to controlType
Diffstat (limited to 'jquery-ui-timepicker-addon.js')
-rw-r--r--jquery-ui-timepicker-addon.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js
index f2b154a..8c8af0c 100644
--- a/jquery-ui-timepicker-addon.js
+++ b/jquery-ui-timepicker-addon.js
@@ -208,9 +208,16 @@
return val.toUpperCase();
});
- // select control type will always be available
- if(tp_inst._defaults.controlType == 'slider' && $.fn.slider === undefined){
- tp_inst._defaults.controlType = 'select';
+ // controlType is string - key to our this._controls
+ if(typeof(tp_inst._defaults.controlType) === 'string'){
+ if(tp_inst._defaults.controlType == 'slider' && $.fn.slider === undefined){
+ tp_inst._defaults.controlType = 'select';
+ }
+ tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
+ }
+ // controlType is an object and must implement create, options, value methods
+ else{
+ tp_inst.control = tp_inst._defaults.controlType;
}
if (tp_inst._defaults.timezoneList === null) {
@@ -226,7 +233,6 @@
tp_inst._defaults.timezoneList = timezoneList;
}
- tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType];
tp_inst.timezone = tp_inst._defaults.timezone;
tp_inst.hour = tp_inst._defaults.hour;
tp_inst.minute = tp_inst._defaults.minute;
@@ -907,6 +913,7 @@
return $t.data(opts);
o[opts] = val;
}
+ else o = opts;
return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min || $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step'));
},
value: function(tp_inst, obj, val){