Ticket #26633: customize-controls.js.patch
File customize-controls.js.patch, 900 bytes (added by , 11 years ago) |
---|
-
src/wp-admin/js/customize-controls.js
705 705 body = $( document.body ), 706 706 overlay = body.children('.wp-full-overlay'); 707 707 708 // Prevent the form from saving when enter is pressed. 709 $('#customize-controls').on( 'keydown', function( e ) { 710 if ( $( e.target ).is('textarea') ) 711 return; 712 713 if ( 13 === e.which ) // Enter 708 // Prevent the form from saving when enter is pressed on an input element. 709 $( '#customize-controls' ).on( 'keydown', function( e ) { 710 var is_enter = ( 13 === e.which ); 711 if ( is_enter && $( e.target ).is( 'input:not([type=button])' ) ) { 714 712 e.preventDefault(); 715 }); 713 } 714 } ); 716 715 717 716 // Initialize Previewer 718 717 previewer = new api.Previewer({