Ticket #33029: 33029.2.diff
| File 33029.2.diff, 1.1 KB (added by , 11 years ago) |
|---|
-
wp-admin/js/common.js
385 385 var $this = $( this ), 386 386 $button = $( '<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>' ), 387 387 btnText = commonL10n.dismiss || ''; 388 focusedElementAtt = 'data-wp-focused-element'; 388 389 389 390 // Ensure plain text 390 391 $button.find( '.screen-reader-text' ).text( btnText ); … … 391 392 392 393 $this.append( $button ); 393 394 395 // Note currently focused element before removing focus for click event. 396 $button.on( 'mousedown.wp-dismiss-notice', function( event ) { 397 $( ':focus' ).attr( focusedElementAtt, '' ); 398 }); 399 394 400 $button.on( 'click.wp-dismiss-notice', function( event ) { 395 401 event.preventDefault(); 396 402 $this.fadeTo( 100 , 0, function() { … … 398 404 $(this).remove(); 399 405 }); 400 406 }); 407 408 // Restore focus to prevously focused element. 409 $( '[' + focusedElementAtt + ']' ).focus().removeAttr( focusedElementAtt ); 401 410 }); 411 412 402 413 }); 403 414 404 415 // Init screen meta
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)