mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Nav menus: Provide visual feedback when attempting to add an empty custom link.
props pragunbhutani for the initial patch. fixes #18517. Built from https://develop.svn.wordpress.org/trunk@32690 git-svn-id: http://core.svn.wordpress.org/trunk@32660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
acec5066f6
commit
9d0ab29bc4
@ -817,6 +817,8 @@ var wpNavMenu;
|
||||
}
|
||||
});
|
||||
$('#add-custom-links input[type="text"]').keypress(function(e){
|
||||
$('#customlinkdiv').removeClass('form-invalid');
|
||||
|
||||
if ( e.keyCode === 13 ) {
|
||||
e.preventDefault();
|
||||
$( '#submit-customlinkdiv' ).click();
|
||||
@ -919,8 +921,10 @@ var wpNavMenu;
|
||||
|
||||
processMethod = processMethod || api.addMenuItemToBottom;
|
||||
|
||||
if ( '' === url || 'http://' == url )
|
||||
if ( '' === url || 'http://' == url ) {
|
||||
$('#customlinkdiv').addClass('form-invalid');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Show the ajax spinner
|
||||
$( '.customlinkdiv .spinner' ).addClass( 'is-active' );
|
||||
|
2
wp-admin/js/nav-menu.min.js
vendored
2
wp-admin/js/nav-menu.min.js
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.3-alpha-32689';
|
||||
$wp_version = '4.3-alpha-32690';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user