Changeset 47294
- Timestamp:
- 02/16/2020 06:25:54 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/_enqueues/lib/nav-menu.js
r47122 r47294 1163 1163 var settings, item, 1164 1164 matchedSection = /#(.*)$/.exec(clickedEl.href); 1165 1165 1166 if ( matchedSection && matchedSection[1] ) { 1166 1167 settings = $('#'+matchedSection[1]); … … 1187 1188 var settings = $( clickedEl ).closest( '.menu-item-settings' ), 1188 1189 thisMenuItem = $( clickedEl ).closest( '.menu-item' ); 1189 thisMenuItem.removeClass('menu-item-edit-active').addClass('menu-item-edit-inactive'); 1190 settings.setItemData( settings.data('menu-item-data') ).hide(); 1190 1191 thisMenuItem.removeClass( 'menu-item-edit-active' ).addClass( 'menu-item-edit-inactive' ); 1192 settings.setItemData( settings.data( 'menu-item-data' ) ).hide(); 1193 // Restore the title of the currently active/expanded menu item. 1194 thisMenuItem.find( '.menu-item-title' ).text( settings.data( 'menu-item-data' )['menu-item-title'] ); 1195 1191 1196 return false; 1192 1197 }, … … 1196 1201 menuName = $('#menu-name'), 1197 1202 menuNameVal = menuName.val(); 1203 1198 1204 // Cancel and warn if invalid menu name. 1199 1205 if ( ! menuNameVal || ! menuNameVal.replace( /\s+/, '' ) ) { … … 1224 1230 eventOnClickMenuItemDelete : function(clickedEl) { 1225 1231 var itemID = parseInt(clickedEl.id.replace('delete-', ''), 10); 1232 1226 1233 api.removeMenuItem( $('#menu-item-' + itemID) ); 1227 1234 api.registerChange();
Note: See TracChangeset
for help on using the changeset viewer.