Skip to content
This repository was archived by the owner on Feb 14, 2022. It is now read-only.

Commit 2f9ff08

Browse files
Add unit param to all control methods
1 parent 6ea99b7 commit 2f9ff08

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@
435435
h = aph + 12;
436436
}
437437
}
438-
tp_inst.control.value(tp_inst, tp_inst[f+'_slider'], parseInt(h,10));
438+
tp_inst.control.value(tp_inst, tp_inst[f+'_slider'], litem, parseInt(h,10));
439439

440440
tp_inst._onTimeChange();
441441
tp_inst._onSelectHandler();
@@ -629,20 +629,20 @@
629629
millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10);
630630

631631
if (this.hour_slider) {
632-
this.control.options(this, this.hour_slider, { min: this._defaults.hourMin, max: hourMax });
633-
this.control.value(this, this.hour_slider, this.hour);
632+
this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax });
633+
this.control.value(this, this.hour_slider, 'hour', this.hour);
634634
}
635635
if (this.minute_slider) {
636-
this.control.options(this, this.minute_slider, { min: this._defaults.minuteMin, max: minMax });
637-
this.control.value(this, this.minute_slider, this.minute);
636+
this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax });
637+
this.control.value(this, this.minute_slider, 'minute', this.minute);
638638
}
639639
if (this.second_slider) {
640-
this.control.options(this, this.second_slider, { min: this._defaults.secondMin, max: secMax });
641-
this.control.value(this, this.second_slider, this.second);
640+
this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax });
641+
this.control.value(this, this.second_slider, 'second', this.second);
642642
}
643643
if (this.millisec_slider) {
644-
this.control.options(this, this.millisec_slider, { min: this._defaults.millisecMin, max: millisecMax });
645-
this.control.value(this, this.millisec_slider, this.millisec);
644+
this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax });
645+
this.control.value(this, this.millisec_slider, 'millisec', this.millisec);
646646
}
647647
}
648648

@@ -653,10 +653,10 @@
653653
* on time change is also called when the time is updated in the text field
654654
*/
655655
_onTimeChange: function() {
656-
var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider) : false,
657-
minute = (this.minute_slider) ? this.control.value(this, this.minute_slider) : false,
658-
second = (this.second_slider) ? this.control.value(this, this.second_slider) : false,
659-
millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider) : false,
656+
var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false,
657+
minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false,
658+
second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false,
659+
millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false,
660660
timezone = (this.timezone_select) ? this.timezone_select.val() : false,
661661
o = this._defaults;
662662

@@ -832,15 +832,15 @@
832832
max: rtl? min*-1 : max,
833833
step: step,
834834
slide: function(event, ui) {
835-
tp_inst.control.value(tp_inst, $(this), rtl? ui.value*-1:ui.value);
835+
tp_inst.control.value(tp_inst, $(this), unit, rtl? ui.value*-1:ui.value);
836836
tp_inst._onTimeChange();
837837
},
838838
stop: function(event, ui) {
839839
tp_inst._onSelectHandler();
840840
}
841841
});
842842
},
843-
options: function(tp_inst, obj, opts, val){
843+
options: function(tp_inst, obj, unit, opts, val){
844844
if(tp_inst._defaults.isRTL){
845845
if(typeof(opts) == 'string'){
846846
if(opts == 'min' || opts == 'max'){
@@ -863,7 +863,7 @@
863863
return obj.slider(opts, val);
864864
return obj.slider(opts);
865865
},
866-
value: function(tp_inst, obj, val){
866+
value: function(tp_inst, obj, unit, val){
867867
if(tp_inst._defaults.isRTL){
868868
if(val !== undefined)
869869
return obj.slider('value', val*-1);
@@ -905,7 +905,7 @@
905905

906906
return obj;
907907
},
908-
options: function(tp_inst, obj, opts, val){
908+
options: function(tp_inst, obj, unit, opts, val){
909909
var o = {},
910910
$t = obj.children('select');
911911
if(typeof(opts) == 'string'){
@@ -916,7 +916,7 @@
916916
else o = opts;
917917
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'));
918918
},
919-
value: function(tp_inst, obj, val){
919+
value: function(tp_inst, obj, unit, val){
920920
var $t = obj.children('select');
921921
if(val !== undefined)
922922
return $t.val(val);

0 commit comments

Comments
 (0)