From 112af0751f64a0350a9f514e4eb7565339562450 Mon Sep 17 00:00:00 2001 From: Ella Iseulde Van Dorpe Date: Sat, 17 Oct 2015 07:03:30 +0000 Subject: [PATCH] Admin: fix repositioning notices Fixes #34294. Props afercia. git-svn-id: https://develop.svn.wordpress.org/trunk@35238 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/js/common.js | 11 +---------- src/wp-includes/js/autosave.js | 6 ++++-- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/wp-admin/js/common.js b/src/wp-admin/js/common.js index 35ce89f3e5..d04430cf48 100644 --- a/src/wp-admin/js/common.js +++ b/src/wp-admin/js/common.js @@ -369,16 +369,7 @@ $(document).ready( function() { }); } - // Move .notice, .updated and .error alert boxes. Don't move boxes designed to be inline. - $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 ); + $( 'div.updated, div.error, div.notice' ).not( '.inline' ).insertAfter( $( '.wrap' ).children( ':header' ).first() ); // Make notices dismissible $( '.notice.is-dismissible' ).each( function() { diff --git a/src/wp-includes/js/autosave.js b/src/wp-includes/js/autosave.js index c79d5a45a1..0ffc293f5b 100644 --- a/src/wp-includes/js/autosave.js +++ b/src/wp-includes/js/autosave.js @@ -345,8 +345,10 @@ window.autosave = function() { excerpt: excerpt }; - $notice = $( '#local-storage-notice' ); - $('.wrap h2').first().after( $notice.addClass( 'notice-warning' ).show() ); + $notice = $( '#local-storage-notice' ) + .insertAfter( $( '.wrap' ).children( ':header' ).first() ) + .addClass( 'notice-warning' ) + .show(); $notice.on( 'click.autosave-local', function( event ) { var $target = $( event.target );