Make WordPress Core

Ticket #28835: 28835_1.patch

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

Remove console.log and exported patch from src

  • wp-admin/js/customize-widgets.js

    # This patch file was generated by NetBeans IDE
    # Following Index: paths are relative to: C:\xampp\htdocs\wordpress\trunk\src
    # 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        /**