Ticket #21283: 21283.15.diff
File 21283.15.diff, 1.7 KB (added by , 12 years ago) |
---|
-
wp-includes/js/customize-loader.js
29 29 event.preventDefault(); 30 30 31 31 // Load the theme. 32 Loader.open( $(this).attr('href') );32 Loader.open( $(this).attr('href'), $(this) ); 33 33 }); 34 34 35 35 // Add navigation listeners. … … 60 60 Loader.close(); 61 61 }, 62 62 63 open: function( src ) {63 open: function( src, linkClicked ) { 64 64 var hash; 65 65 66 66 if ( this.active ) … … 109 109 history.pushState( { customize: src }, '', src ); 110 110 else if ( ! $.support.history && $.support.hashchange && hash ) 111 111 window.location.hash = 'wp_customize=on&' + hash; 112 113 // Capture link id to return focus to after closing customizer 114 if ( linkClicked ) 115 _wpCustomizeLoaderSettings[ 'returnFocus' ] = linkClicked; 112 116 113 117 this.trigger( 'open' ); 114 118 }, … … 123 127 this.active = false; 124 128 125 129 this.trigger( 'close' ); 130 131 // Return focus to link that was originally clicked 132 _wpCustomizeLoaderSettings[ 'returnFocus' ].focus(); 126 133 }, 127 134 128 135 closed: function() { -
wp-admin/js/customize-controls.js
876 876 $('.back').keydown( function( event ) { 877 877 if ( 9 === event.which ) // tab 878 878 return; 879 var thisHref = $(this).attr('href');880 879 if ( 13 === event.which ) // enter 881 window.location = thisHref;880 parent.send( 'close' ); 882 881 event.preventDefault(); 883 882 }); 884 883