Changeset 40094 for branches/4.7
- Timestamp:
- 02/21/2017 06:51:47 AM (8 years ago)
- Location:
- branches/4.7
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.7
-
branches/4.7/src/wp-admin/js/customize-nav-menus.js
r39570 r40094 1510 1510 */ 1511 1511 _setupTitleUI: function() { 1512 var control = this; 1513 1512 var control = this, titleEl; 1513 1514 // Ensure that whitespace is trimmed on blur so placeholder can be shown. 1515 control.container.find( '.edit-menu-item-title' ).on( 'blur', function() { 1516 $( this ).val( $.trim( $( this ).val() ) ); 1517 } ); 1518 1519 titleEl = control.container.find( '.menu-item-title' ); 1514 1520 control.setting.bind( function( item ) { 1521 var trimmedTitle, titleText; 1515 1522 if ( ! item ) { 1516 1523 return; 1517 1524 } 1518 1519 var titleEl = control.container.find( '.menu-item-title' ), 1520 titleText = item.title || item.original_title || api.Menus.data.l10n.untitled;1525 trimmedTitle = $.trim( item.title ); 1526 1527 titleText = trimmedTitle || item.original_title || api.Menus.data.l10n.untitled; 1521 1528 1522 1529 if ( item._invalid ) { … … 1525 1532 1526 1533 // Don't update to an empty title. 1527 if ( item.title || item.original_title ) {1534 if ( trimmedTitle || item.original_title ) { 1528 1535 titleEl 1529 1536 .text( titleText )
Note: See TracChangeset
for help on using the changeset viewer.