Nav menus: Provide visual feedback when attempting to add an empty custom link.
props pragunbhutani for the initial patch. fixes #18517. git-svn-id: https://develop.svn.wordpress.org/trunk@32690 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e069a38598
commit
112fc6d369
@ -817,6 +817,8 @@ var wpNavMenu;
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#add-custom-links input[type="text"]').keypress(function(e){
|
$('#add-custom-links input[type="text"]').keypress(function(e){
|
||||||
|
$('#customlinkdiv').removeClass('form-invalid');
|
||||||
|
|
||||||
if ( e.keyCode === 13 ) {
|
if ( e.keyCode === 13 ) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
$( '#submit-customlinkdiv' ).click();
|
$( '#submit-customlinkdiv' ).click();
|
||||||
@ -919,8 +921,10 @@ var wpNavMenu;
|
|||||||
|
|
||||||
processMethod = processMethod || api.addMenuItemToBottom;
|
processMethod = processMethod || api.addMenuItemToBottom;
|
||||||
|
|
||||||
if ( '' === url || 'http://' == url )
|
if ( '' === url || 'http://' == url ) {
|
||||||
|
$('#customlinkdiv').addClass('form-invalid');
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Show the ajax spinner
|
// Show the ajax spinner
|
||||||
$( '.customlinkdiv .spinner' ).addClass( 'is-active' );
|
$( '.customlinkdiv .spinner' ).addClass( 'is-active' );
|
||||||
|
Loading…
Reference in New Issue
Block a user