Ticket #32814: 32814.7.diff
File 32814.7.diff, 5.6 KB (added by , 10 years ago) |
---|
-
wp-admin/js/customize-nav-menus.js
1647 1647 return; 1648 1648 } 1649 1649 var select = widgetControl.container.find( 'select' ); 1650 if ( select.find( 'option[value=' + String( menuId ) + ']' ).length === 0) {1650 if ( 0 === select.find( 'option[value=' + String( menuId ) + ']' ).length ) { 1651 1651 select.append( new Option( name, menuId ) ); 1652 1652 } 1653 1653 } ); 1654 $( '#available-widgets-list .widget-inside:has(input.id_base[value=nav_menu]) select:first' ).append( new Option( name, menuId ) ); 1654 // Add the menu to the widget template. 1655 var template = $( '#available-widgets-list .widget-inside:has( input.id_base[ value=nav_menu ] ) select:first' ); 1656 1657 // Avoid duplicate insertion. 1658 if ( 0 === template.find( 'option[value=' + String( menuId ) + ']' ).length ) { 1659 template.append(new Option(name, menuId)); 1660 } 1655 1661 } 1656 1662 }, 1657 1663 … … 1695 1701 var select = widgetControl.container.find( 'select' ); 1696 1702 select.find( 'option[value=' + String( menuId ) + ']' ).text( name ); 1697 1703 }); 1698 $( '#available-widgets-list .widget-inside:has(input.id_base[value=nav_menu]) select:first option[value=' + String( menuId ) + ']' ).text( name );1699 1704 } 1700 1705 } ); 1701 1706 … … 1767 1772 menuItemControl.setting.set( setting ); 1768 1773 }); 1769 1774 }); 1775 1770 1776 }); 1771 1772 1777 control.isReordering = false; 1773 1778 1774 1779 /** … … 1835 1840 } 1836 1841 select.find( 'option[value=' + String( menuId ) + ']' ).remove(); 1837 1842 }); 1838 $( '#available-widgets-list .widget-inside:has(input.id_base[value=nav_menu]) select:first option[value=' + String( menuId ) + ']' ).remove(); 1843 1839 1844 }, 1840 1845 1841 1846 // Setup theme location checkboxes. … … 2232 2237 2233 2238 // Focus on the new menu section. 2234 2239 api.section( customizeId ).focus(); // @todo should we focus on the new menu's control and open the add-items panel? Thinking user flow... 2240 2241 // Fix an issue with extra space at top immediately after creating new menu. 2242 $( '#menu-to-edit' ).css( 'margin-top', 0 ); 2235 2243 } 2236 2244 }); 2237 2245 … … 2370 2378 } 2371 2379 } ); 2372 2380 2381 /** 2382 * Update the saved menu in any custom menu widgets. 2383 * If the previous_term_id item is selected, reselect the 2384 * item with the updated term_id. 2385 */ 2386 api.control.each( function( setting ) { 2387 // Only act on nav_menu widgets. 2388 if ( ! setting.extended( api.controlConstructor.widget_form ) || 2389 'nav_menu' !== setting.params.widget_id_base ) { 2390 return; 2391 } 2392 var select, oldMenuOption, oldMenuSelected, newMenuOption; 2393 select = setting.container.find( 'select' ); 2394 oldMenuOption = select.find( 'option[value=' + String( update.previous_term_id ) + ']' ); 2395 oldMenuSelected = select.find( 'option[value=' + String( update.previous_term_id ) + ']:selected' ); 2396 newMenuOption = select.find( 'option[value=' + String( update.term_id ) + ']' ); 2397 2398 // Adjust menu options matching the old ID, setting them to the new ID. 2399 if ( oldMenuSelected.length !== 0 && newMenuOption !== 0 ) { 2400 // Remove the old option. 2401 oldMenuOption.remove(); 2402 // Select the new option. 2403 newMenuOption.attr( 'selected', true ).trigger( 'change' ); 2404 } 2405 2406 2407 } ); 2408 2373 2409 if ( oldSection.expanded.get() ) { 2374 2410 // @todo This doesn't seem to be working. 2375 2411 newSection.expand(); -
wp-admin/js/customize-widgets.js
1041 1041 params.wp_customize = 'on'; 1042 1042 params.nonce = api.Widgets.data.nonce; 1043 1043 params.theme = api.settings.theme.stylesheet; 1044 params.customized = wp.customize.previewer.query().customized; 1044 1045 1045 1046 data = $.param( params ); 1046 1047 $inputs = this._getInputs( $widgetContent ); -
wp-admin/js/user-profile.js
38 38 39 39 parentform.on('submit', function(){ 40 40 pw_field2.val( pw_field.val() ); 41 pw_field. attr('type', 'password');41 pw_field.each(function () { this.type = "password"; }); 42 42 }); 43 43 44 44 … … 93 93 pw_togglebtn.on( 'click', function() { 94 94 var show = pw_togglebtn.attr( 'data-toggle' ); 95 95 if ( show == 1 ) { 96 pw_field. attr( 'type', 'text');96 pw_field.each(function () { this.type = "text"; }); 97 97 pw_togglebtn.attr( 'data-toggle', 0 ) 98 98 .find( '.text' ) 99 99 .text( 'hide' ) 100 100 ; 101 101 } else { 102 pw_field. attr( 'type', 'password');102 pw_field.each(function () { this.type = "password"; }); 103 103 pw_togglebtn.attr( 'data-toggle', 1 ) 104 104 .find( '.text' ) 105 105 .text( 'show' ) -
wp-includes/nav-menu.php
12 12 * 13 13 * @since 3.0.0 14 14 * 15 * @param string $menu Menu ID, slug, or name .15 * @param string $menu Menu ID, slug, or name - or the menu object. 16 16 * @return object|false False if $menu param isn't supplied or term does not exist, menu object if successful. 17 17 */ 18 18 function wp_get_nav_menu_object( $menu ) { 19 19 $menu_obj = false; 20 if ( $menu ) { 20 21 if ( is_object( $menu ) ) { 22 $menu_obj = $menu; 23 } 24 25 if ( $menu && ! $menu_obj ) { 21 26 $menu_obj = get_term( $menu, 'nav_menu' ); 22 27 23 28 if ( ! $menu_obj ) {