Prevent 'Enter menu name here' menus, and offer some feedback. props koopersmith, fixes #13703.

git-svn-id: https://develop.svn.wordpress.org/trunk@15124 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2010-06-03 03:33:54 +00:00
parent 6d968a6f7b
commit d5a2b82b96
5 changed files with 20 additions and 5 deletions
File diff suppressed because one or more lines are too long
+8
View File
@@ -529,6 +529,14 @@ body.js .item-order {
color: #fff;
}
.major-publishing-actions .form-invalid {
border-radius: 4px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
padding-left: 4px;
margin-left: -4px;
}
/* Clearfix */
#menu-item-name-wrap:after,
+8 -1
View File
@@ -806,7 +806,14 @@ var wpNavMenu;
},
eventOnClickMenuSave : function(clickedEl) {
var locs = '';
var locs = '',
menuName = $('#menu-name'),
menuNameVal = menuName.val();
// Cancel and warn if invalid menu name
if( !menuNameVal || menuNameVal == menuName.attr('title') || !menuNameVal.replace(/\s+/, '') ) {
menuName.parent().addClass('form-invalid');
return false;
}
// Copy menu theme locations
$('#nav-menu-theme-locations select').each(function() {
locs += '<input type="hidden" name="' + this.name + '" value="' + $(this).val() + '" />';
File diff suppressed because one or more lines are too long