diff options
author | Trent Richardson <trentdrichardson@gmail.com> | 2012-10-02 10:11:18 -0400 |
---|---|---|
committer | Trent Richardson <trentdrichardson@gmail.com> | 2012-10-02 10:11:18 -0400 |
commit | 1cfb16062ab704409f65d90dafeb9920fe4c9098 (patch) | |
tree | 6acc4f439001b2b6cc127b6538a2140f3f2ff0d4 | |
parent | 0e0ef06cd252f1ff613fc71436a4b3c531288a34 (diff) | |
download | jQuery-Timepicker-Addon-1cfb16062ab704409f65d90dafeb9920fe4c9098.zip jQuery-Timepicker-Addon-1cfb16062ab704409f65d90dafeb9920fe4c9098.tar.gz jQuery-Timepicker-Addon-1cfb16062ab704409f65d90dafeb9920fe4c9098.tar.bz2 |
Condensed slider generation
-rw-r--r-- | index.html | 3 | ||||
-rw-r--r-- | jquery-ui-timepicker-addon.js | 71 |
2 files changed, 5 insertions, 69 deletions
@@ -182,6 +182,9 @@ <dt>timezoneText</dt> <dd><em>Default: "Timezone", A Localization Setting</em> - Label used to identify the timezone slider.</dd> + + <dt>isRTL</dt> + <dd><em>Default: false, A Localization Setting</em> - Right to Left support.</dd> </dl> <h3>Alt Field Options</h3> diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 0bace09..032f46e 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -393,77 +393,11 @@ $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
}
- // Updated by Peter Medeiros:
- // - Pass in Event and UI instance into slide function
- this.hour_slider = $tp.find('.ui_tpicker_hour_slider').prop('slide', null).slider({
- orientation: "horizontal",
- value: this.hour,
- min: o.hourMin,
- max: max.hour,
- step: o.stepHour,
- slide: function(event, ui) {
- tp_inst.hour_slider.slider("option", "value", ui.value);
- tp_inst._onTimeChange();
- },
- stop: function(event, ui) {
- tp_inst._onSelectHandler();
- }
- });
-
- this.minute_slider = $tp.find('.ui_tpicker_minute_slider').prop('slide', null).slider({
- orientation: "horizontal",
- value: this.minute,
- min: o.minuteMin,
- max: max.minute,
- step: o.stepMinute,
- slide: function(event, ui) {
- tp_inst.minute_slider.slider("option", "value", ui.value);
- tp_inst._onTimeChange();
- },
- stop: function(event, ui) {
- tp_inst._onSelectHandler();
- }
- });
-
- this.second_slider = $tp.find('.ui_tpicker_second_slider').prop('slide', null).slider({
- orientation: "horizontal",
- value: this.second,
- min: o.secondMin,
- max: max.second,
- step: o.stepSecond,
- slide: function(event, ui) {
- tp_inst.second_slider.slider("option", "value", ui.value);
- tp_inst._onTimeChange();
- },
- stop: function(event, ui) {
- tp_inst._onSelectHandler();
- }
- });
-
- this.millisec_slider = $tp.find('.ui_tpicker_millisec_slider').prop('slide', null).slider({
- orientation: "horizontal",
- value: this.millisec,
- min: o.millisecMin,
- max: max.millisec,
- step: o.stepMillisec,
- slide: function(event, ui) {
- tp_inst.millisec_slider.slider("option", "value", ui.value);
- tp_inst._onTimeChange();
- },
- stop: function(event, ui) {
- tp_inst._onSelectHandler();
- }
- });
-
// add sliders, adjust grids, add events
for(var i=0,l=tp_inst.units.length; i<l; i++){
litem = tp_inst.units[i];
uitem = litem.substr(0,1).toUpperCase() + litem.substr(1);
- /*
- Something fishy happens when assigning to tp_inst['hour_slider'] instead of tp_inst.hour_slider, I think
- it is because it is assigned as a prototype. Clicking the slider will always change to the previous value
- not the new one clicked. Ideally this works and reduces the 80+ lines of code above
// add the slider
tp_inst[litem+'_slider'] = $tp.find('.ui_tpicker_'+litem+'_slider').prop('slide', null).slider({
orientation: "horizontal",
@@ -472,15 +406,14 @@ max: max[litem],
step: o['step'+uitem],
slide: function(event, ui) {
- tp_inst[litem+'_slider'].slider("option", "value", ui.value);
+ $(this).slider("option", "value", ui.value);
tp_inst._onTimeChange();
},
stop: function(event, ui) {
//Emulate datepicker onSelect behavior. Call on slidestop.
tp_inst._onSelectHandler();
}
- });
- */
+ });
// adjust the grid and add click event
if (o['show'+uitem] && o[litem+'Grid'] > 0) {
|