Make WordPress Core

Ticket #28835: 28835.patch

File 28835.patch, 2.2 KB (added by sathishn, 11 years ago)

Bug Fix

  • customize-widgets.js

    # This patch file was generated by NetBeans IDE
    # Following Index: paths are relative to: C:\xampp\htdocs\wordpress\trunk\src\wp-admin\js
    # This patch can be applied using context Tools: Patch action on respective folder.
    # It uses platform neutral UTF-8 encoding and \n newlines.
    # Above lines and this line are ignored by the patching process.
     
    316316                                isEsc = ( event.which === 27 ),
    317317                                isDown = ( event.which === 40 ),
    318318                                isUp = ( event.which === 38 ),
     319                                isTab = (event.which === 9),
     320                                isShift = (event.shiftKey),
    319321                                selected = null,
    320322                                firstVisible = this.$el.find( '> .widget-tpl:visible:first' ),
    321323                                lastVisible = this.$el.find( '> .widget-tpl:visible:last' ),
     324                                isLastWidgetFocused =  $( event.target ).is( '.widget-tpl:visible:last' ),
    322325                                isSearchFocused = $( event.target ).is( this.$search );
    323326
    324327                        if ( isDown || isUp ) {
     
    357360                        } else if ( isEsc ) {
    358361                                this.close( { returnFocus: true } );
    359362                        }
     363                       
     364                        if(isTab){
     365                            if(isShift){
     366                                if(isSearchFocused){
     367                                    $('.control-section:has(.open) .add-new-widget').focus();
     368                                    event.preventDefault();
    360369                }
     370                            }
     371                            else{
     372                                if(isLastWidgetFocused){
     373                                    $('.control-section:has(.open) .add-new-widget').focus();
     374                                    event.preventDefault();
     375                                }
     376                            }
     377                        }
     378                }
    361379        });
    362380
    363381        /**
     
    15381556                 * Add classes to the widget_form controls to assist with styling
    15391557                 */
    15401558                _applyCardinalOrderClassNames: function() {
     1559                        console.log('cardinal');
    15411560                        this.$sectionContent.find( '.customize-control-widget_form' )
    15421561                                .removeClass( 'first-widget' )
    15431562                                .removeClass( 'last-widget' )