Make WordPress Core

Ticket #25112: 25112.2.diff

File 25112.2.diff, 3.4 KB (added by atimmer, 12 years ago)
  • src/wp-admin/js/nav-menu.js

     
    402402                refreshAdvancedAccessibility : function() {
    403403
    404404                        // Hide all links by default
    405                         $( '.menu-item-settings .field-move a' ).hide();
     405                        $( '.menu-item-settings .field-move a' ).css( 'display', 'none' );
    406406
    407407                        $( '.item-edit' ).each( function() {
    408408                                var $this = $(this),
    409409                                        movement = [],
    410410                                        availableMovement = '',
    411                                         menuItem = $this.parents( 'li.menu-item' ).first(),
     411                                        menuItem = $this.closest( 'li.menu-item' ).first(),
    412412                                        depth = menuItem.menuItemDepth(),
    413413                                        isPrimaryMenuItem = ( 0 === depth ),
    414                                         itemName = $this.parents( '.menu-item-handle' ).find( '.menu-item-title' ).text(),
     414                                        itemName = $this.closest( '.menu-item-handle' ).find( '.menu-item-title' ).text(),
    415415                                        position = parseInt( menuItem.index() ),
    416416                                        prevItemDepth = ( isPrimaryMenuItem ) ? depth : parseInt( depth - 1 ),
    417417                                        prevItemNameLeft = menuItem.prevAll('.menu-item-depth-' + prevItemDepth).first().find( '.menu-item-title' ).text(),
     
    422422                                // Where can they move this menu item?
    423423                                if ( 0 !== position ) {
    424424                                        var thisLink = menuItem.find( '.menus-move-up' );
    425                                         thisLink.prop( 'title', menus.moveUp ).show();
     425                                        thisLink.prop( 'title', menus.moveUp ).css( 'display', 'inline' );
    426426                                }
    427427
    428428                                if ( 0 !== position && isPrimaryMenuItem ) {
    429429                                        var thisLink = menuItem.find( '.menus-move-top' );
    430                                         thisLink.prop( 'title', menus.moveToTop ).show();
     430                                        thisLink.prop( 'title', menus.moveToTop ).css( 'display', 'inline' );
    431431                                }
    432432
    433433                                if ( position + 1 !== totalMenuItems && 0 !== position ) {
    434434                                        var thisLink = menuItem.find( '.menus-move-down' );
    435                                         thisLink.prop( 'title', menus.moveDown ).show();
     435                                        thisLink.prop( 'title', menus.moveDown ).css( 'display', 'inline' );
    436436                                }
    437437
    438438                                if ( 0 === position && 0 !== hasSameDepthSibling ) {
    439439                                        var thisLink = menuItem.find( '.menus-move-down' );
    440                                         thisLink.prop( 'title', menus.moveDown ).show();
     440                                        thisLink.prop( 'title', menus.moveDown ).css( 'display', 'inline' );
    441441                                }
    442442
    443443                                if ( ! isPrimaryMenuItem ) {
    444444                                        var thisLink = menuItem.find( '.menus-move-left' ),
    445445                                                thisLinkText = menus.outFrom.replace( '%s', prevItemNameLeft );
    446                                         thisLink.prop( 'title', menus.moveOutFrom.replace( '%s', prevItemNameLeft ) ).html( thisLinkText ).show();
     446                                        thisLink.prop( 'title', menus.moveOutFrom.replace( '%s', prevItemNameLeft ) ).html( thisLinkText ).css( 'display', 'inline' );
    447447                                }
    448448
    449449                                if ( 0 !== position ) {
    450450                                        if ( menuItem.find( '.menu-item-data-parent-id' ).val() !== menuItem.prev().find( '.menu-item-data-db-id' ).val() ) {
    451451                                                var thisLink = menuItem.find( '.menus-move-right' ),
    452452                                                        thisLinkText = menus.under.replace( '%s', prevItemNameRight );
    453                                                 thisLink.prop( 'title', menus.moveUnder.replace( '%s', prevItemNameRight ) ).html( thisLinkText ).show();
     453                                                thisLink.prop( 'title', menus.moveUnder.replace( '%s', prevItemNameRight ) ).html( thisLinkText ).css( 'display', 'inline' );
    454454                                        }
    455455                                }
    456456
    457457                                if ( isPrimaryMenuItem ) {
    458                                         var primaryItems = $( '.menu-item-depth-0' ),
     458                                        var primaryItems = $( '#menu-to-edit' ).children( '.menu-item-depth-0' ),
    459459                                                itemPosition = primaryItems.index( menuItem ) + 1,
    460460                                                totalMenuItems = primaryItems.length,
    461461