Changeset 39994
- Timestamp:
- 01/26/2017 06:07:58 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-nav-menus.js
r39558 r39994 1519 1519 */ 1520 1520 _setupTitleUI: function() { 1521 var control = this; 1522 1521 var control = this, titleEl; 1522 1523 // Ensure that whitespace is trimmed on blur so placeholder can be shown. 1524 control.container.find( '.edit-menu-item-title' ).on( 'blur', function() { 1525 $( this ).val( $.trim( $( this ).val() ) ); 1526 } ); 1527 1528 titleEl = control.container.find( '.menu-item-title' ); 1523 1529 control.setting.bind( function( item ) { 1530 var trimmedTitle, titleText; 1524 1531 if ( ! item ) { 1525 1532 return; 1526 1533 } 1527 1528 var titleEl = control.container.find( '.menu-item-title' ), 1529 titleText = item.title || item.original_title || api.Menus.data.l10n.untitled;1534 trimmedTitle = $.trim( item.title ); 1535 1536 titleText = trimmedTitle || item.original_title || api.Menus.data.l10n.untitled; 1530 1537 1531 1538 if ( item._invalid ) { … … 1534 1541 1535 1542 // Don't update to an empty title. 1536 if ( item.title || item.original_title ) {1543 if ( trimmedTitle || item.original_title ) { 1537 1544 titleEl 1538 1545 .text( titleText )
Note: See TracChangeset
for help on using the changeset viewer.