Admin menu: double-click icon to go to default (first) location, show section header when folded

git-svn-id: http://svn.automattic.com/wordpress/trunk@9196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2008-10-16 10:32:26 +00:00
parent 3be95653d0
commit c4453c9a0f
4 changed files with 22 additions and 6 deletions

View File

@ -52,6 +52,10 @@ ul.wp-submenu, ul.wp-submenu li, ul.wp-submenu a {
padding: 0;
}
#wpcontent #adminmenu .wp-submenu li.wp-submenu-head {
padding: 3px 4px 4px 10px;
}
ul#adminmenu li.wp-menu-separator {
background-color: #fff;
height: 3px;

View File

@ -5,6 +5,7 @@ adminMenu = {
init : function() {
$('#adminmenu a').attr('tabindex', '10');
$('#adminmenu a.wp-has-submenu').click( function() { return adminMenu.toggle( $(this).siblings('ul') ); } );
$('#adminmenu li.wp-has-submenu img.wp-menu-image').dblclick( function() { window.location = $(this).siblings('a.wp-has-submenu')[0].href; } );
var li = document.createElement('li'); // temp
$(li).attr('id', 'menu-toggle').html('««').click(function(){
@ -52,12 +53,13 @@ adminMenu = {
if (off) {
$('#wpbody-content').css('marginLeft', '140px');
$('#adminmenu').removeClass('folded');
$('#adminmenu li.wp-submenu-head').hide();
$('#adminmenu a.wp-has-submenu').show();
$('#adminmenu li.wp-has-submenu').unbind().css('width', '');
} else {
$('#adminmenu').addClass('folded');
$('#adminmenu a.wp-has-submenu').hide();
$('#adminmenu .wp-submenu').hide();
$('#adminmenu a.wp-has-submenu, #adminmenu .wp-submenu').hide();
$('#adminmenu li.wp-submenu-head').show();
$('#wpbody-content').css('marginLeft', '38px');
$('#adminmenu li.wp-has-submenu').css({'width':'24px'}).hoverIntent({
over: function(){ $(this).find('.wp-submenu').show(); },

View File

@ -79,7 +79,7 @@ function _wp_menu_output( &$menu, &$submenu, $submenu_as_parent = true ) {
}
if ( !empty($submenu[$item[2]]) ) {
echo "\n\t<ul class='wp-submenu'>";
echo "\n\t<ul class='wp-submenu'><li class='wp-submenu-head' style='display:none;'>{$item[0]}</li>";
$first = true;
foreach ( $submenu[$item[2]] as $sub_key => $sub_item ) {
if ( !current_user_can($sub_item[1]) )

View File

@ -706,13 +706,13 @@ ul#adminmenu li.write-new-button a {
margin-top: 4px;
}
#adminmenu li .wp-submenu {
#adminmenu .wp-submenu {
margin: 0;
position: relative;
z-index: 11;
}
#adminmenu ul.wp-submenu li {
#adminmenu .wp-submenu li {
padding: 0;
margin: 0;
border-top: 1px dotted #DDDDDD;
@ -726,7 +726,7 @@ ul#adminmenu li.write-new-button a {
padding: 4px 4px 0;
}
#adminmenu ul.wp-submenu li.current {
#adminmenu .wp-submenu li.current {
background-color: #fff;
}
@ -750,6 +750,16 @@ ul#adminmenu li.write-new-button a {
margin: 0;
}
#adminmenu .wp-submenu li.wp-submenu-head {
border-top: 0 none;
padding: 4px 4px 4px 10px;
cursor: default;
background-color: #E4F2FD;
}
#adminmenu.folded .wp-submenu {
position: absolute;
margin: -1px 0 0 30px;