Make WordPress Core

Ticket #30637: 30637.diff

File 30637.diff, 970 bytes (added by pento, 12 years ago)
  • src/wp-includes/js/admin-bar.js

     
    4141                        var mobileEvent = /Mobile\/.+Safari/.test(navigator.userAgent) ? 'touchstart' : 'click';
    4242                        // close any open drop-downs when the click/touch is not on the toolbar
    4343                        $(document.body).on( mobileEvent+'.wp-mobile-hover', function(e) {
    44                                 if ( !$(e.target).closest('#wpadminbar').length )
    45                                         adminbar.find('li.menupop.hover').removeClass('hover');
     44                                if ( !$( e.target ).closest( '#wpadminbar' ).length ) {
     45                                        adminbar.find( 'li.menupop.hover' ).removeClass( 'hover' );
     46                                } else {
     47                                        var item = $( e.target ).closest( '.ab-item' );
     48                                        if ( item.length && item.parent( '.menupop' ).length ) {
     49                                                adminbar.find( 'li.menupop.hover' ).removeClass( 'hover' );
     50                                                e.preventDefault();
     51                                        }
     52                                }
    4653                        });
    4754                };
    4855