Ticket #29906: 29906-9-comment15.diff
File 29906-9-comment15.diff, 7.1 KB (added by , 9 years ago) |
---|
-
wp-admin/js/common.js
721 721 $( '#wp-admin-bar-menu-toggle' ).on( 'click.wp-responsive', function( event ) { 722 722 event.preventDefault(); 723 723 $wpwrap.toggleClass( 'wp-responsive-open' ); 724 $adminbar.find('li.menupop.hover').removeClass('hover'); 724 725 if ( self.isOpen() ) { 725 726 $(this).find('a').attr( 'aria-expanded', 'true' ); 726 727 $( '#adminmenu a:first' ).focus(); -
wp-includes/admin-bar.php
160 160 'id' => 'menu-toggle', 161 161 'title' => '<span class="ab-icon"></span><span class="screen-reader-text">' . __( 'Menu' ) . '</span>', 162 162 'href' => '#', 163 'meta' => array( 164 'class' => 'menupop', 165 ), 163 166 ) ); 164 167 } 165 168 } … … 187 190 'id' => 'my-account', 188 191 'parent' => 'top-secondary', 189 192 'title' => $howdy . $avatar, 190 'href' => $profile_url,193 'href' => wp_is_mobile() ? '#' : $profile_url, 191 194 'meta' => array( 192 195 'class' => $class, 193 196 ), … … 271 274 $blogname = sprintf( __('Global Dashboard: %s'), esc_html( get_current_site()->site_name ) ); 272 275 } 273 276 274 $title = wp_html_excerpt( $blogname, 40, '…' ); 277 // wp_is_mobile() ? 278 // $title = '<a class="ab-icon"></a><span class="ab-label">' . wp_html_excerpt( $blogname, 40, '…' ) . '</span>' 279 // : 280 $title = wp_html_excerpt( $blogname, 40, '…' ); 275 281 276 $ wp_admin_bar->add_menu(array(282 $site_menu = array( 277 283 'id' => 'site-name', 278 284 'title' => $title, 279 'href' => is_admin() ? home_url( '/' ) : admin_url(), 280 ) ); 285 ); 281 286 287 if ( ! wp_is_mobile() ) { 288 $site_menu['href'] = is_admin() ? home_url( '/' ) : admin_url(); 289 } 282 290 // Create submenu items. 291 $wp_admin_bar->add_menu( $site_menu ); 283 292 293 284 294 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 ) );292 295 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' ) ) { 294 297 $wp_admin_bar->add_menu( array( 295 298 'parent' => 'site-name', 296 299 'id' => 'edit-site', … … 298 301 'href' => network_admin_url( 'site-info.php?id=' . get_current_blog_id() ), 299 302 ) ); 300 303 } 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 ) ); 302 310 } else { 303 311 // We're on the front end, link to the Dashboard. 304 312 $wp_admin_bar->add_menu( array( … … 356 364 ) ); 357 365 $wp_admin_bar->add_menu( array( 358 366 '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', 359 373 'id' => 'network-admin-s', 360 374 'title' => __( 'Sites' ), 361 375 'href' => network_admin_url( 'sites.php' ), … … 594 608 if ( ! $actions ) 595 609 return; 596 610 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>'; 598 615 599 $ wp_admin_bar->add_menu(array(616 $site_menu = array( 600 617 'id' => 'new-content', 601 618 'title' => $title, 602 'href' => admin_url( current( array_keys( $actions ) ) ), 603 ) ); 619 ); 604 620 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 605 627 foreach ( $actions as $link => $action ) { 606 628 list( $title, $id ) = $action; 607 629 -
wp-includes/css/admin-bar.css
207 207 right: 100%; 208 208 } 209 209 210 #wpadminbar .ab-top-menu > li > .ab-item:focus,211 210 #wpadminbar.nojq .quicklinks .ab-top-menu > li > .ab-item:focus, 212 #wpadminbar .ab-top-menu > li:hover > .ab-item,213 211 #wpadminbar .ab-top-menu > li.hover > .ab-item { 214 212 background: #32373c; 215 213 color: #45bbe6; 216 214 } 217 215 218 #wpadminbar > #wp-toolbar li:hover span.ab-label,219 216 #wpadminbar > #wp-toolbar li.hover span.ab-label, 220 217 #wpadminbar > #wp-toolbar a:focus span.ab-label { 221 218 color: #45bbe6; … … 244 241 245 242 #wpadminbar .ab-icon:before, 246 243 #wpadminbar .ab-item:before, 244 #wpadminbar .ab-item, 247 245 #wpadminbar #adminbarsearch:before { 248 246 position: relative; 249 247 -webkit-transition: all .1s ease-in-out; … … 276 274 #wpadminbar .quicklinks .menupop.hover ul li a:focus, 277 275 #wpadminbar.nojs .quicklinks .menupop:hover ul li a:hover, 278 276 #wpadminbar.nojs .quicklinks .menupop:hover ul li a:focus, 279 #wpadminbar li:hover .ab-icon:before,280 #wpadminbar li:hover .ab-item:before,281 277 #wpadminbar li a:focus .ab-icon:before, 282 278 #wpadminbar li .ab-item:focus:before, 283 279 #wpadminbar li.hover .ab-icon:before, … … 818 814 819 815 #wpadminbar .ab-top-menu > .menupop > .ab-sub-wrapper .ab-item { 820 816 font-size: 16px; 821 padding: 6px 15px 12px;817 padding: 8px 15px 8px; 822 818 } 823 819 824 820 #wpadminbar .ab-top-menu > .menupop > .ab-sub-wrapper a:empty { … … 906 902 width: 52px; 907 903 display: block; 908 904 } 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 } 910 913 /* Updates */ 911 914 #wpadminbar #wp-admin-bar-updates { 912 915 text-align: center; -
wp-includes/js/admin-bar.js
28 28 e.stopPropagation(); 29 29 e.preventDefault(); 30 30 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 } 31 35 } 32 36 $('#wpadminbar').click( function(e) { 37 if ( e.target.id != 'wpadminbar' ) { 38 } else { 39 adminbar.find('li.menupop.hover').removeClass('hover'); 40 } 41 }); 33 42 if ( unbind ) { 34 43 $('li.menupop').off('click.wp-mobile-hover'); 35 44 disableHoverIntent = false; … … 123 132 target.siblings('.ab-sub-wrapper').find('.ab-item').each(refresh); 124 133 }); 125 134 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 134 135 // fix focus bug in WebKit 135 136 $('.screen-reader-shortcut').keydown( function(e) { 136 137 var id, ua;