Make WordPress Core

Changeset 25622


Ignore:
Timestamp:
09/25/2013 04:22:29 PM (11 years ago)
Author:
nacin
Message:

Only show top-level items when adding pages to a User's First Nav Menu. (This is also the title of Dave's first children's book.)

props lessbloat.
fixes #25122.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/nav-menu.js

    r25546 r25622  
    179179                                listItemDBIDMatch = re.exec( t.attr('name') ),
    180180                                listItemDBID = 'undefined' == typeof listItemDBIDMatch[1] ? 0 : parseInt(listItemDBIDMatch[1], 10);
     181                           
     182                            // Only show top level items
     183                            if (0 !== t.closest('ul.children').length)
     184                                return;
     185                           
    181186                            if ( this.className && -1 != this.className.indexOf('add-to-top') )
    182187                                processMethod = api.addMenuItemToTop;
Note: See TracChangeset for help on using the changeset viewer.