Ticket #25112: 25112.2.diff
File 25112.2.diff, 3.4 KB (added by , 12 years ago) |
---|
-
src/wp-admin/js/nav-menu.js
402 402 refreshAdvancedAccessibility : function() { 403 403 404 404 // Hide all links by default 405 $( '.menu-item-settings .field-move a' ). hide();405 $( '.menu-item-settings .field-move a' ).css( 'display', 'none' ); 406 406 407 407 $( '.item-edit' ).each( function() { 408 408 var $this = $(this), 409 409 movement = [], 410 410 availableMovement = '', 411 menuItem = $this. parents( 'li.menu-item' ).first(),411 menuItem = $this.closest( 'li.menu-item' ).first(), 412 412 depth = menuItem.menuItemDepth(), 413 413 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(), 415 415 position = parseInt( menuItem.index() ), 416 416 prevItemDepth = ( isPrimaryMenuItem ) ? depth : parseInt( depth - 1 ), 417 417 prevItemNameLeft = menuItem.prevAll('.menu-item-depth-' + prevItemDepth).first().find( '.menu-item-title' ).text(), … … 422 422 // Where can they move this menu item? 423 423 if ( 0 !== position ) { 424 424 var thisLink = menuItem.find( '.menus-move-up' ); 425 thisLink.prop( 'title', menus.moveUp ). show();425 thisLink.prop( 'title', menus.moveUp ).css( 'display', 'inline' ); 426 426 } 427 427 428 428 if ( 0 !== position && isPrimaryMenuItem ) { 429 429 var thisLink = menuItem.find( '.menus-move-top' ); 430 thisLink.prop( 'title', menus.moveToTop ). show();430 thisLink.prop( 'title', menus.moveToTop ).css( 'display', 'inline' ); 431 431 } 432 432 433 433 if ( position + 1 !== totalMenuItems && 0 !== position ) { 434 434 var thisLink = menuItem.find( '.menus-move-down' ); 435 thisLink.prop( 'title', menus.moveDown ). show();435 thisLink.prop( 'title', menus.moveDown ).css( 'display', 'inline' ); 436 436 } 437 437 438 438 if ( 0 === position && 0 !== hasSameDepthSibling ) { 439 439 var thisLink = menuItem.find( '.menus-move-down' ); 440 thisLink.prop( 'title', menus.moveDown ). show();440 thisLink.prop( 'title', menus.moveDown ).css( 'display', 'inline' ); 441 441 } 442 442 443 443 if ( ! isPrimaryMenuItem ) { 444 444 var thisLink = menuItem.find( '.menus-move-left' ), 445 445 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' ); 447 447 } 448 448 449 449 if ( 0 !== position ) { 450 450 if ( menuItem.find( '.menu-item-data-parent-id' ).val() !== menuItem.prev().find( '.menu-item-data-db-id' ).val() ) { 451 451 var thisLink = menuItem.find( '.menus-move-right' ), 452 452 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' ); 454 454 } 455 455 } 456 456 457 457 if ( isPrimaryMenuItem ) { 458 var primaryItems = $( ' .menu-item-depth-0' ),458 var primaryItems = $( '#menu-to-edit' ).children( '.menu-item-depth-0' ), 459 459 itemPosition = primaryItems.index( menuItem ) + 1, 460 460 totalMenuItems = primaryItems.length, 461 461