r114976 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114975‎ | r114976 | r114977 >
Date:21:08, 19 April 2012
Author:foxtrott
Status:new
Tags:
Comment:

fix bug 35652 (SemanticFormsInputs: Datepicker and timepicker: wrong tab order)
Modified paths:
  • /trunk/extensions/SemanticFormsInputs/libs/datepicker.js (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/libs/datetimepicker.js (modified) (history)
  • /trunk/extensions/SemanticFormsInputs/libs/timepicker.js (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticFormsInputs/libs/datetimepicker.js
@@ -10,6 +10,8 @@
1111
1212 var input = jQuery( '#' + inputId );
1313
 14+ var tabindex = input.attr('tabindex');
 15+
1416 var hiddenInput = jQuery( '<input type="hidden" >' );
1517
1618 hiddenInput.attr( {
@@ -72,7 +74,7 @@
7375
7476 } else {
7577
76 - var resetbutton = jQuery('<button type="button" class="ui-datetimepicker-trigger ' + params.userClasses + '" ><img src="' + params.resetButtonImage + '" alt="..." title="..."></button>');
 78+ var resetbutton = jQuery('<button type="button" class="ui-datetimepicker-trigger ' + params.userClasses + '" tabindex="' + tabindex + '" ><img src="' + params.resetButtonImage + '" alt="..." title="..."></button>');
7779 input.before( resetbutton );
7880
7981 resetbutton.click( function(){
Index: trunk/extensions/SemanticFormsInputs/libs/datepicker.js
@@ -28,6 +28,8 @@
2929 }
3030
3131
 32+ var tabindex = inputShow.attr('tabindex');
 33+
3234 var re = /\d{4}\/\d{2}\/\d{2}/
3335
3436 if ( params.disabled ) {
@@ -52,7 +54,7 @@
5355 // append reset button if image is set
5456 if ( params.resetButtonImage && ! params.partOfDTP ) {
5557
56 - var resetbutton = jQuery( '<button type="button" class="ui-datepicker-trigger ' + params.userClasses + '" ><img src="' + params.resetButtonImage + '" alt="..." title="..."></button>' );
 58+ var resetbutton = jQuery( '<button type="button" class="ui-datepicker-trigger ' + params.userClasses + '"><img src="' + params.resetButtonImage + '" alt="..." title="..."></button>' );
5759 inputShow.after( resetbutton );
5860 resetbutton.click( function(){
5961 inputShow.datepicker( 'setDate', null);
@@ -75,6 +77,11 @@
7678 'dateFormat': params.dateFormat,
7779 'beforeShowDay': function ( date ) {return SFI_DP_checkDate( '#' + input_id + '_show', date );}
7880 } );
 81+
 82+ // at least in FF tabindex needs to be set delayed
 83+ setTimeout(function(){
 84+ inputShow.siblings('button').attr('tabindex', tabindex);
 85+ }, 0);
7986
8087 if ( params.minDate ) {
8188 inputShow.datepicker( 'option', 'minDate',
Index: trunk/extensions/SemanticFormsInputs/libs/timepicker.js
@@ -42,11 +42,14 @@
4343 input = inputShow;
4444 }
4545
 46+ var tabindex = inputShow.attr('tabindex');
 47+
4648 // append time picker button
4749 var button = jQuery( '<button type="button" ></button>' );
4850 button.attr({
4951 'class': params.userClasses,
50 - 'id': inputID + '_button'
 52+ 'id': inputID + '_button',
 53+ 'tabindex': tabindex
5154 });
5255
5356
@@ -80,7 +83,8 @@
8184 var resetbutton = jQuery('<button type="button" ></button>');
8285 resetbutton.attr({
8386 'class': params.userClasses,
84 - 'id': inputID + '_resetbutton'
 87+ 'id': inputID + '_resetbutton',
 88+ 'tabindex': tabindex
8589 });
8690
8791 if ( params.disabled ) {