+ }
+
+ if ( ! isIOS && ! isAndroid ) {
+ $adminmenu.find( 'li.wp-has-submenu' ).hoverIntent({
+ over: function() {
+ var $menuItem = $( this ),
+ $submenu = $menuItem.find( '.wp-submenu' ),
+ top = parseInt( $submenu.css( 'top' ), 10 );
+
+ if ( isNaN( top ) || top > -5 ) { // the submenu is visible
+ return;
+ }
+
+ if ( $adminmenu.data( 'wp-responsive' ) ) {
+ // The menu is in responsive mode, bail
+ return;
+ }
+
+ adjustSubmenu( $menuItem );
+ $adminmenu.find( 'li.opensub' ).removeClass( 'opensub' );
+ $menuItem.addClass( 'opensub' );
+ },
+ out: function(){
+ if ( $adminmenu.data( 'wp-responsive' ) ) {
+ // The menu is in responsive mode, bail
+ return;
+ }
+
+ $( this ).removeClass( 'opensub' ).find( '.wp-submenu' ).css( 'margin-top', '' );
+ },
+ timeout: 200,
+ sensitivity: 7,
+ interval: 90
+ });
+
+ $adminmenu.on( 'focus.adminmenu', '.wp-submenu a', function( event ) {
+ if ( $adminmenu.data( 'wp-responsive' ) ) {
+ // The menu is in responsive mode, bail
+ return;
+ }
+
+ $( event.target ).closest( 'li.menu-top' ).addClass( 'opensub' );
+ }).on( 'blur.adminmenu', '.wp-submenu a', function( event ) {
+ if ( $adminmenu.data( 'wp-responsive' ) ) {
+ return;
+ }
+
+ $( event.target ).closest( 'li.menu-top' ).removeClass( 'opensub' );
+ }).find( 'li.wp-has-submenu.wp-not-current-submenu' ).on( 'focusin.adminmenu', function() {
+ adjustSubmenu( $( this ) );
+ });
+ }
+
+ /*
+ * The `.below-h2` class is here just for backward compatibility with plugins
+ * that are (incorrectly) using it. Do not use. Use `.inline` instead. See #34570.
+ */
+ $( 'div.updated, div.error, div.notice' ).not( '.inline, .below-h2' ).insertAfter( $( '.wrap h1, .wrap h2' ).first() );
+
+ // Make notices dismissible
+ function makeNoticesDismissible() {
+ $( '.notice.is-dismissible' ).each( function() {
+ var $el = $( this ),
+ $button = $( '<button type="button" class="notice-dismiss"><span class="screen-reader-text"></span></button>' ),
+ btnText = commonL10n.dismiss || '';
+
+ // Ensure plain text
+ $button.find( '.screen-reader-text' ).text( btnText );
+ $button.on( 'click.wp-dismiss-notice', function( event ) {
+ event.preventDefault();
+ $el.fadeTo( 100, 0, function() {
+ $el.slideUp( 100, function() {
+ $el.remove();
+ });
+ });
+ });
+
+ $el.append( $button );
+ });
+ }
+
+ $document.on( 'wp-updates-notice-added wp-plugin-install-error wp-plugin-update-error wp-plugin-delete-error wp-theme-install-error wp-theme-delete-error', makeNoticesDismissible );
+
+ // Init screen meta
+ screenMeta.init();