Make WordPress Core

Changeset 32690


Ignore:
Timestamp:
06/04/2015 04:30:04 AM (10 years ago)
Author:
helen
Message:

Nav menus: Provide visual feedback when attempting to add an empty custom link.

props pragunbhutani for the initial patch.
fixes #18517.

File:
1 edited

Legend:

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

    r32175 r32690  
    818818            });
    819819            $('#add-custom-links input[type="text"]').keypress(function(e){
     820                $('#customlinkdiv').removeClass('form-invalid');
     821
    820822                if ( e.keyCode === 13 ) {
    821823                    e.preventDefault();
     
    920922            processMethod = processMethod || api.addMenuItemToBottom;
    921923
    922             if ( '' === url || 'http://' == url )
     924            if ( '' === url || 'http://' == url ) {
     925                $('#customlinkdiv').addClass('form-invalid');
    923926                return false;
     927            }
    924928
    925929            // Show the ajax spinner
Note: See TracChangeset for help on using the changeset viewer.