Making WordPress.org

Changeset 2310


Ignore:
Timestamp:
01/18/2016 08:24:57 PM (8 years ago)
Author:
ocean90
Message:

Trac: Don't make action text inputs and select fields focusable until the corresponding action is focused.

Also allow action select fields to be clicked directly.

Props SergeyBiryukov.
Fixes #1521.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js

    r2187 r2310  
    333333            });
    334334
    335             // Allow action text inputs to be clicked directly.
     335            // Allow action text inputs and select fields to be clicked directly.
    336336            $('#action')
    337                 .find('input[type=text]').enable().focus( function() {
     337                .find('input[type=text], select').enable().focus( function() {
    338338                    $(this).siblings('input[type=radio]').click();
    339339                }).end()
     
    341341                .find('div').has('select').find('input[type=radio]').change( function() {
    342342                    $(this).siblings('select').enable();
     343                });
     344
     345            // Hide action text inputs and select fields from keyboard, unless the corresponding action is focused.
     346            $('#action')
     347                .find('input[type=text], select').each( function() {
     348                    $(this).attr('tabindex', '-1');
     349                }).end()
     350                .find('input').blur( function() {
     351                    $(this).parent().find('input[type=text], select').attr('tabindex', '-1');
     352                }).focus( function() {
     353                    $(this).parent().find('input[type=text], select').removeAttr('tabindex');
    343354                });
    344355
Note: See TracChangeset for help on using the changeset viewer.