Make WordPress Core

Ticket #29906: 29906-9-comment15.diff

File 29906-9-comment15.diff, 7.1 KB (added by seanchayes, 9 years ago)
  • wp-admin/js/common.js

     
    721721                        $( '#wp-admin-bar-menu-toggle' ).on( 'click.wp-responsive', function( event ) {
    722722                                event.preventDefault();
    723723                                $wpwrap.toggleClass( 'wp-responsive-open' );
     724                                $adminbar.find('li.menupop.hover').removeClass('hover');
    724725                                if ( self.isOpen() ) {
    725726                                        $(this).find('a').attr( 'aria-expanded', 'true' );
    726727                                        $( '#adminmenu a:first' ).focus();
  • wp-includes/admin-bar.php

     
    160160                        'id'    => 'menu-toggle',
    161161                        'title' => '<span class="ab-icon"></span><span class="screen-reader-text">' . __( 'Menu' ) . '</span>',
    162162                        'href'  => '#',
     163                        'meta'      => array(
     164                                'class'     => 'menupop',
     165                        ),
    163166                ) );
    164167        }
    165168}
     
    187190                'id'        => 'my-account',
    188191                'parent'    => 'top-secondary',
    189192                'title'     => $howdy . $avatar,
    190                 'href'      => $profile_url,
     193                'href'      => wp_is_mobile() ? '#' : $profile_url,
    191194                'meta'      => array(
    192195                        'class'     => $class,
    193196                ),
     
    271274                $blogname = sprintf( __('Global Dashboard: %s'), esc_html( get_current_site()->site_name ) );
    272275        }
    273276
    274         $title = wp_html_excerpt( $blogname, 40, '&hellip;' );
     277//      wp_is_mobile() ?
     278//              $title = '<a class="ab-icon"></a><span class="ab-label">' . wp_html_excerpt( $blogname, 40, '&hellip;' ) . '</span>'
     279//              :
     280                $title = wp_html_excerpt( $blogname, 40, '&hellip;' );
    275281
    276         $wp_admin_bar->add_menu( array(
     282        $site_menu = array(
    277283                'id'    => 'site-name',
    278284                'title' => $title,
    279                 'href'  => is_admin() ? home_url( '/' ) : admin_url(),
    280         ) );
     285        );
    281286
     287        if ( ! wp_is_mobile() ) {
     288                $site_menu['href'] = is_admin() ? home_url( '/' ) : admin_url();
     289        }
    282290        // Create submenu items.
     291        $wp_admin_bar->add_menu( $site_menu );
    283292
     293
    284294        if ( is_admin() ) {
    285                 // Add an option to visit the site.
    286                 $wp_admin_bar->add_menu( array(
    287                         'parent' => 'site-name',
    288                         'id'     => 'view-site',
    289                         'title'  => __( 'Visit Site' ),
    290                         'href'   => home_url( '/' ),
    291                 ) );
    292295
    293                 if ( is_blog_admin() && is_multisite() && current_user_can( 'manage_sites' ) ) {
     296                if ( ( is_network_admin() || is_blog_admin() ) && is_multisite() && current_user_can( 'manage_sites' ) ) {
    294297                        $wp_admin_bar->add_menu( array(
    295298                                'parent' => 'site-name',
    296299                                'id'     => 'edit-site',
     
    298301                                'href'   => network_admin_url( 'site-info.php?id=' . get_current_blog_id() ),
    299302                        ) );
    300303                }
    301 
     304                $wp_admin_bar->add_menu( array(
     305                        'parent' => 'site-name',
     306                        'id'     => 'visit-site',
     307                        'title'  => __( 'Visit Site' ),
     308                        'href'   => home_url(),
     309                ) );
    302310        } else {
    303311                // We're on the front end, link to the Dashboard.
    304312                $wp_admin_bar->add_menu( array(
     
    356364                ) );
    357365                $wp_admin_bar->add_menu( array(
    358366                        'parent' => 'network-admin',
     367                        'id'     => 'network-admin-m',
     368                        'title'  => __( 'My Sites' ),
     369                        'href'   => get_admin_url( $wp_admin_bar->user->active_blog->blog_id, 'my-sites.php' ),
     370                ) );
     371                $wp_admin_bar->add_menu( array(
     372                        'parent' => 'network-admin',
    359373                        'id'     => 'network-admin-s',
    360374                        'title'  => __( 'Sites' ),
    361375                        'href'   => network_admin_url( 'sites.php' ),
     
    594608        if ( ! $actions )
    595609                return;
    596610
    597         $title = '<span class="ab-icon"></span><span class="ab-label">' . _x( 'New', 'admin bar menu group label' ) . '</span>';
     611        wp_is_mobile() ?
     612                $title = '<span class="ab-label">' . _x( 'New', 'admin bar menu group label' ) . '</span>'
     613                :
     614                $title = '<span class="ab-icon"></span><span class="ab-label">' . _x( 'New', 'admin bar menu group label' ) . '</span>';
    598615
    599         $wp_admin_bar->add_menu( array(
     616        $site_menu = array(
    600617                'id'    => 'new-content',
    601618                'title' => $title,
    602                 'href'  => admin_url( current( array_keys( $actions ) ) ),
    603         ) );
     619        );
    604620
     621        if ( ! wp_is_mobile() ) {
     622                $site_menu['href'] =  admin_url( current( array_keys( $actions ) ) );
     623        }
     624        // Create submenu items.
     625        $wp_admin_bar->add_menu( $site_menu );
     626
    605627        foreach ( $actions as $link => $action ) {
    606628                list( $title, $id ) = $action;
    607629
  • wp-includes/css/admin-bar.css

     
    207207        right: 100%;
    208208}
    209209
    210 #wpadminbar .ab-top-menu > li > .ab-item:focus,
    211210#wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus,
    212 #wpadminbar .ab-top-menu > li:hover > .ab-item,
    213211#wpadminbar .ab-top-menu > li.hover > .ab-item {
    214212        background: #32373c;
    215213        color: #45bbe6;
    216214}
    217215
    218 #wpadminbar > #wp-toolbar li:hover span.ab-label,
    219216#wpadminbar > #wp-toolbar li.hover span.ab-label,
    220217#wpadminbar > #wp-toolbar a:focus span.ab-label {
    221218        color: #45bbe6;
     
    244241
    245242#wpadminbar .ab-icon:before,
    246243#wpadminbar .ab-item:before,
     244#wpadminbar .ab-item,
    247245#wpadminbar #adminbarsearch:before {
    248246        position: relative;
    249247        -webkit-transition: all .1s ease-in-out;
     
    276274#wpadminbar .quicklinks .menupop.hover ul li a:focus,
    277275#wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover,
    278276#wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus,
    279 #wpadminbar li:hover .ab-icon:before,
    280 #wpadminbar li:hover .ab-item:before,
    281277#wpadminbar li a:focus .ab-icon:before,
    282278#wpadminbar li .ab-item:focus:before,
    283279#wpadminbar li.hover .ab-icon:before,
     
    818814
    819815        #wpadminbar .ab-top-menu > .menupop > .ab-sub-wrapper .ab-item {
    820816                font-size: 16px;
    821                 padding: 6px 15px 12px;
     817                padding: 8px 15px 8px;
    822818        }
    823819
    824820        #wpadminbar .ab-top-menu > .menupop > .ab-sub-wrapper a:empty {
     
    906902                width: 52px;
    907903                display: block;
    908904        }
    909 
     905        #wpadminbar #wp-admin-bar-new-content > .ab-item:before {
     906                content: '\f132';
     907                font-size: 40px;
     908                text-align: center;
     909                top: 6px;
     910                width: 52px;
     911                height: 30px;
     912        }
    910913        /* Updates */
    911914        #wpadminbar #wp-admin-bar-updates {
    912915                text-align: center;
  • wp-includes/js/admin-bar.js

     
    2828                                        e.stopPropagation();
    2929                                        e.preventDefault();
    3030                                        el.addClass('hover');
     31                                } else if ( el.children('.ab-empty-item') ) {
     32                                        if ( el.hasClass('hover') ) {
     33                                                adminbar.find('li.menupop.hover').removeClass('hover');
     34                                        }
    3135                                }
    32 
     36                                $('#wpadminbar').click( function(e) {
     37                                        if ( e.target.id != 'wpadminbar' ) {
     38                                        } else {
     39                                                adminbar.find('li.menupop.hover').removeClass('hover');
     40                                        }
     41                                });
    3342                                if ( unbind ) {
    3443                                        $('li.menupop').off('click.wp-mobile-hover');
    3544                                        disableHoverIntent = false;
     
    123132                        target.siblings('.ab-sub-wrapper').find('.ab-item').each(refresh);
    124133                });
    125134
    126                 $('#wpadminbar').click( function(e) {
    127                         if ( e.target.id != 'wpadminbar' && e.target.id != 'wp-admin-bar-top-secondary' )
    128                                 return;
    129 
    130                         e.preventDefault();
    131                         $('html, body').animate({ scrollTop: 0 }, 'fast');
    132                 });
    133 
    134135                // fix focus bug in WebKit
    135136                $('.screen-reader-shortcut').keydown( function(e) {
    136137                        var id, ua;