Skip to content

Commit f4ace05

Browse files
Add sliderAccess integration
1 parent 9a19d87 commit f4ace05

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

Diff for: jquery-ui-timepicker-addon.js

+14-20
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* jQuery timepicker addon
33
* By: Trent Richardson [http://trentrichardson.com]
44
* Version 0.9.8-dev
5-
* Last Modified: 10/02/2011
5+
* Last Modified: 12/02/2011
66
*
77
* Copyright 2011 Trent Richardson
88
* Dual licensed under the MIT and GPL licenses.
@@ -12,8 +12,8 @@
1212
* HERES THE CSS:
1313
* .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
1414
* .ui-timepicker-div dl { text-align: left; }
15-
* .ui-timepicker-div dl dt { height: 25px; }
16-
* .ui-timepicker-div dl dd { margin: -25px 10px 10px 65px; }
15+
* .ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
16+
* .ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
1717
* .ui-timepicker-div td { font-size: 90%; }
1818
* .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
1919
*/
@@ -83,7 +83,9 @@ function Timepicker() {
8383
altFieldTimeOnly: true,
8484
showTimepicker: true,
8585
timezoneIso8609: false,
86-
timezoneList: null
86+
timezoneList: null,
87+
addSliderAccess: false,
88+
sliderAccessArgs: null
8789
};
8890
$.extend(this._defaults, this.regional['']);
8991
}
@@ -362,10 +364,6 @@ $.extend(Timepicker.prototype, {
362364
minuteGridSize = 0,
363365
secondGridSize = 0,
364366
millisecGridSize = 0,
365-
sliderChange = function(event, ui) {
366-
$(this).slider( "option", "value", ui.value);
367-
tp_inst._onTimeChange();
368-
},
369367
size;
370368

371369
// Hours
@@ -471,9 +469,6 @@ $.extend(Timepicker.prototype, {
471469
slide: function(event, ui) {
472470
tp_inst.hour_slider.slider( "option", "value", ui.value);
473471
tp_inst._onTimeChange();
474-
},
475-
change: function(event, ui) {
476-
tp_inst._onTimeChange();
477472
}
478473
});
479474

@@ -489,9 +484,6 @@ $.extend(Timepicker.prototype, {
489484
slide: function(event, ui) {
490485
tp_inst.minute_slider.slider( "option", "value", ui.value);
491486
tp_inst._onTimeChange();
492-
},
493-
change: function(event, ui) {
494-
tp_inst._onTimeChange();
495487
}
496488
});
497489

@@ -504,9 +496,6 @@ $.extend(Timepicker.prototype, {
504496
slide: function(event, ui) {
505497
tp_inst.second_slider.slider( "option", "value", ui.value);
506498
tp_inst._onTimeChange();
507-
},
508-
change: function(event, ui) {
509-
tp_inst._onTimeChange();
510499
}
511500
});
512501

@@ -519,9 +508,6 @@ $.extend(Timepicker.prototype, {
519508
slide: function(event, ui) {
520509
tp_inst.millisec_slider.slider( "option", "value", ui.value);
521510
tp_inst._onTimeChange();
522-
},
523-
change: function(event, ui) {
524-
tp_inst._onTimeChange();
525511
}
526512
});
527513

@@ -648,6 +634,14 @@ $.extend(Timepicker.prototype, {
648634
this.minute_slider.bind('slidestop',onSelectDelegate);
649635
this.second_slider.bind('slidestop',onSelectDelegate);
650636
this.millisec_slider.bind('slidestop',onSelectDelegate);
637+
638+
// slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
639+
if (this._defaults.addSliderAccess){
640+
var sliderAccessArgs = this._defaults.sliderAccessArgs;
641+
setTimeout(function(){ // fix for inline mode
642+
$tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
643+
},0);
644+
}
651645
}
652646
},
653647

0 commit comments

Comments
 (0)