Admin: fix repositioning notices
Fixes #34294. Props afercia. git-svn-id: https://develop.svn.wordpress.org/trunk@35238 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
cba5390270
commit
112af0751f
@ -369,16 +369,7 @@ $(document).ready( function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move .notice, .updated and .error alert boxes. Don't move boxes designed to be inline.
|
$( 'div.updated, div.error, div.notice' ).not( '.inline' ).insertAfter( $( '.wrap' ).children( ':header' ).first() );
|
||||||
$firstHeading = $( '.wrap > h1:first' );
|
|
||||||
|
|
||||||
// Back compatibility: if there is no H1, apply to first H2.
|
|
||||||
if ( ! $firstHeading.length ) {
|
|
||||||
$firstHeading = $( '.wrap h2:first' );
|
|
||||||
}
|
|
||||||
|
|
||||||
$firstHeading.nextAll( 'div.updated, div.error, div.notice' ).addClass( 'below-h2' );
|
|
||||||
$( 'div.updated, div.error, div.notice' ).not( '.below-h2, .inline' ).insertAfter( $firstHeading );
|
|
||||||
|
|
||||||
// Make notices dismissible
|
// Make notices dismissible
|
||||||
$( '.notice.is-dismissible' ).each( function() {
|
$( '.notice.is-dismissible' ).each( function() {
|
||||||
|
@ -345,8 +345,10 @@ window.autosave = function() {
|
|||||||
excerpt: excerpt
|
excerpt: excerpt
|
||||||
};
|
};
|
||||||
|
|
||||||
$notice = $( '#local-storage-notice' );
|
$notice = $( '#local-storage-notice' )
|
||||||
$('.wrap h2').first().after( $notice.addClass( 'notice-warning' ).show() );
|
.insertAfter( $( '.wrap' ).children( ':header' ).first() )
|
||||||
|
.addClass( 'notice-warning' )
|
||||||
|
.show();
|
||||||
|
|
||||||
$notice.on( 'click.autosave-local', function( event ) {
|
$notice.on( 'click.autosave-local', function( event ) {
|
||||||
var $target = $( event.target );
|
var $target = $( event.target );
|
||||||
|
Loading…
Reference in New Issue
Block a user