Move the "Add Home Link" functionality to a checkbox on the View All tab of the Pages metabox. Also makes it work non-JS. props filosofo, fixes #13213.

git-svn-id: https://develop.svn.wordpress.org/trunk@14971 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-05-27 02:24:33 +00:00
parent fdf4f195df
commit 9b4a85cdaf
7 changed files with 51 additions and 27 deletions
+3 -9
View File
@@ -38,8 +38,6 @@ var wpNavMenu;
this.attachTabsPanelListeners();
this.attachHomeLinkListener();
this.attachUnsavedChangesListener();
if( api.menuList.length ) // If no menu, we're in the + tab.
@@ -134,8 +132,11 @@ var wpNavMenu;
var t = $(this),
listItemDBIDMatch = re.exec( t.attr('name') ),
listItemDBID = 'undefined' == typeof listItemDBIDMatch[1] ? 0 : parseInt(listItemDBIDMatch[1], 10);
if ( this.className && -1 != this.className.indexOf('add-to-top') )
processMethod = api.addMenuItemToTop;
menuItems[listItemDBID] = t.closest('li').getItemData( 'add-menu-item', listItemDBID );
});
// Add the items
api.addItemToMenu(menuItems, processMethod, function(){
// Deselect the items and hide the ajax spinner
@@ -540,13 +541,6 @@ var wpNavMenu;
$(menuMarkup).hideAdvancedMenuItemFields().prependTo( api.targetList );
},
attachHomeLinkListener : function() {
$('.add-home-link', '.customlinkdiv').click(function(e) {
api.addLinkToMenu( navMenuL10n.homeurl, navMenuL10n.home, api.addMenuItemToTop );
return false;
});
},
attachUnsavedChangesListener : function() {
$('#menu-management input, #menu-management select, #menu-management, #menu-management textarea').change(function(){
api.registerChange();
File diff suppressed because one or more lines are too long