Ticket #18382: 18382.diff
File 18382.diff, 14.7 KB (added by , 10 years ago) |
---|
-
wp-admin/menu-header.php
58 58 $class[] = 'wp-has-current-submenu wp-menu-open'; 59 59 else 60 60 $class[] = 'current'; 61 } elseif ( ! empty( $submenu[ $item[2] ] ) && isset( $user_settings[ 'm' . $menu_setting_increment ] ) && 'o' == $user_settings[ 'm' . $menu_setting_increment ] ) { 62 $class[] = 'wp-menu-open'; 61 // } elseif ( ! empty( $submenu[ $item[2] ] ) && isset( $user_settings[ 'm' . $menu_setting_increment ] ) && 'o' == $user_settings[ 'm' . $menu_setting_increment ] ) { 62 // $class[] = 'wp-menu-open'; 63 } else { 64 $class[] = 'wp-not-current-submenu'; 63 65 } 64 66 65 67 if ( ! empty($item[4]) ) … … 75 77 else 76 78 $img = '<img src="' . $item[6] . '" alt="" />'; 77 79 } 78 $toggle = '<div class="wp-menu-toggle"><br /></div>';79 80 $arrow = '<div class="wp-menu-arrow"><div></div></div>'; 80 81 81 82 $title = wptexturize($item[0]); … … 92 93 $menu_file = substr($menu_file, 0, $pos); 93 94 if ( ( ('index.php' != $submenu[$item[2]][0][2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") ) || !empty($menu_hook)) { 94 95 $admin_is_parent = true; 95 echo "<div class='wp-menu-image'><a href='admin.php?page={$submenu[$item[2]][0][2]}'>$img</a></div>$arrow $toggle<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class$tabindex>$title</a>";96 echo "<div class='wp-menu-image'><a href='admin.php?page={$submenu[$item[2]][0][2]}'>$img</a></div>$arrow<a href='admin.php?page={$submenu[$item[2]][0][2]}'$class$tabindex>$title</a>"; 96 97 } else { 97 echo "\n\t<div class='wp-menu-image'><a href='{$submenu[$item[2]][0][2]}'>$img</a></div>$arrow $toggle<a href='{$submenu[$item[2]][0][2]}'$class$tabindex>$title</a>";98 echo "\n\t<div class='wp-menu-image'><a href='{$submenu[$item[2]][0][2]}'>$img</a></div>$arrow<a href='{$submenu[$item[2]][0][2]}'$class$tabindex>$title</a>"; 98 99 } 99 100 } else if ( !empty($item[2]) && current_user_can($item[1]) ) { 100 101 $menu_hook = get_plugin_page_hook($item[2], 'admin.php'); … … 103 104 $menu_file = substr($menu_file, 0, $pos); 104 105 if ( ('index.php' != $item[2]) && file_exists(WP_PLUGIN_DIR . "/$menu_file") || !empty($menu_hook) ) { 105 106 $admin_is_parent = true; 106 echo "\n\t<div class='wp-menu-image'><a href='admin.php?page={$item[2]}'>$img</a></div>$arrow $toggle<a href='admin.php?page={$item[2]}'$class$tabindex>{$item[0]}</a>";107 echo "\n\t<div class='wp-menu-image'><a href='admin.php?page={$item[2]}'>$img</a></div>$arrow<a href='admin.php?page={$item[2]}'$class$tabindex>{$item[0]}</a>"; 107 108 } else { 108 echo "\n\t<div class='wp-menu-image'><a href='{$item[2]}'>$img</a></div>$arrow $toggle<a href='{$item[2]}'$class$tabindex>{$item[0]}</a>";109 echo "\n\t<div class='wp-menu-image'><a href='{$item[2]}'>$img</a></div>$arrow<a href='{$item[2]}'$class$tabindex>{$item[0]}</a>"; 109 110 } 110 111 } 111 112 -
wp-admin/js/common.dev.js
5 5 init : function() { 6 6 var menu = $('#adminmenu'); 7 7 8 $('.wp-menu-toggle', menu).each( function() {9 var t = $(this), sub = t.siblings('.wp-submenu');10 if ( sub.length )11 t.click(function(){ adminMenu.toggle( sub ); });12 else13 t.hide();14 });8 // $('.wp-menu-toggle', menu).each( function() { 9 // var t = $(this), sub = t.siblings('.wp-submenu'); 10 // if ( sub.length ) 11 // t.click(function(){ adminMenu.toggle( sub ); }); 12 // else 13 // t.hide(); 14 // }); 15 15 16 16 this.favorites(); 17 17 … … 26 26 return false; 27 27 }); 28 28 29 if ( $('body').hasClass('folded') ) 30 this.fold(); 29 this.flyout( $('#adminmenu li.wp-has-submenu') ); 30 31 this.fold( ! $('body').hasClass('folded') ); 31 32 }, 32 33 33 34 restoreMenuState : function() { 34 35 // (perhaps) needed for back-compat 35 36 }, 36 37 37 toggle : function(el) { 38 el.slideToggle(150, function() { 39 var id = el.css('display','').parent().toggleClass( 'wp-menu-open' ).attr('id'); 40 if ( id ) { 41 $('li.wp-has-submenu', '#adminmenu').each(function(i, e) { 42 if ( id == e.id ) { 43 var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c'; 44 setUserSetting( 'm'+i, v ); 45 } 46 }); 47 } 38 flyout: function( el, unbind ) { 39 if ( unbind ) { 40 console.log( 'unbinding flyout', el ); 41 el.unbind(); // Unbind flyout 42 return; 43 } 44 console.log( 'binding flyout', el ); 45 46 el.hoverIntent({ 47 over: function(e){ 48 var m, b, h, o, f; 49 m = $(this).find('.wp-submenu'); 50 b = $(this).offset().top + m.height() + 1; // Bottom offset of the menu 51 h = $('#wpwrap').height(); // Height of the entire page 52 o = 60 + b - h; 53 f = $(window).height() + $(window).scrollTop() - 15; // The fold 54 if ( f < (b - o) ) { 55 o = b - f; 56 } 57 if ( o > 1 ) { 58 m.css({'marginTop':'-'+o+'px'}); 59 } else if ( m.css('marginTop') ) { 60 m.css({'marginTop':''}); 61 } 62 m.addClass('sub-open'); 63 }, 64 out: function(){ 65 $(this).find('.wp-submenu').removeClass('sub-open'); 66 }, 67 timeout: 220, 68 sensitivity: 8, 69 interval: 100 48 70 }); 71 }, 49 72 50 return false; 73 toggle : function() { 74 // Removed in 3.3. 75 // (perhaps) needed for back-compat 51 76 }, 52 77 53 fold : function(off) { 54 if (off) { 55 $('body').removeClass('folded'); 56 $('#adminmenu li.wp-has-submenu').unbind(); 57 } else { 58 $('body').addClass('folded'); 59 $('#adminmenu li.wp-has-submenu').hoverIntent({ 60 over: function(e){ 61 var m, b, h, o, f; 62 m = $(this).find('.wp-submenu'); 63 b = $(this).offset().top + m.height() + 1; // Bottom offset of the menu 64 h = $('#wpwrap').height(); // Height of the entire page 65 o = 60 + b - h; 66 f = $(window).height() + $(window).scrollTop() - 15; // The fold 67 if ( f < (b - o) ) { 68 o = b - f; 69 } 70 if ( o > 1 ) { 71 m.css({'marginTop':'-'+o+'px'}); 72 } else if ( m.css('marginTop') ) { 73 m.css({'marginTop':''}); 74 } 75 m.addClass('sub-open'); 76 }, 77 out: function(){ 78 $(this).find('.wp-submenu').removeClass('sub-open'); 79 }, 80 timeout: 220, 81 sensitivity: 8, 82 interval: 100 83 }); 78 // toggle : function(el) { 79 // el.slideToggle(150, function() { 80 // var id = el.css('display','').parent().toggleClass( 'wp-menu-open' ).attr('id'); 81 // if ( id ) { 82 // $('li.wp-has-submenu', '#adminmenu').each(function(i, e) { 83 // if ( id == e.id ) { 84 // var v = $(e).hasClass('wp-menu-open') ? 'o' : 'c'; 85 // setUserSetting( 'm'+i, v ); 86 // } 87 // }); 88 // } 89 // }); 90 // 91 // return false; 92 // }, 84 93 85 } 94 fold : function( off ) { 95 var current = $('#adminmenu li.wp-has-current-submenu'); 96 97 $('body').toggleClass( 'folded', ! off ); 98 $('body').toggleClass( 'expanded', off ); 99 this.flyout( current, off ); 100 101 // Remove any potentially remaining hoverIntent positioning. 102 if ( off ) 103 current.find('.wp-submenu').css( 'marginTop', '0' ); 104 // if (off) { 105 // $('body').removeClass('folded'); 106 // // $('#adminmenu li.wp-has-submenu').unbind(); 107 // } else { 108 // $('body').addClass('folded'); 109 // } 86 110 }, 87 111 88 112 favorites : function() { -
wp-admin/admin-header.php
80 80 81 81 if ( get_user_setting('mfold') == 'f' ) 82 82 $admin_body_class .= ' folded'; 83 else 84 $admin_body_class .= ' expanded'; 83 85 84 86 if ( is_admin_bar_showing() ) 85 87 $admin_body_class .= ' admin-bar'; -
wp-admin/css/global.dev.css
91 91 #adminmenuback, 92 92 #adminmenuwrap, 93 93 #adminmenu, 94 .js.folded #adminmenu .wp-submenu.sub-open, 95 .js.folded #adminmenu .wp-submenu-wrap { 94 .js #adminmenu .wp-submenu.sub-open, 95 .js #adminmenu .wp-submenu-wrap, 96 .folded #adminmenu .wp-has-current-submenu .wp-submenu.sub-open { 96 97 width: 145px; 97 98 } 98 99 -
wp-admin/css/colors-fresh.dev.css
930 930 border-color: #dfdfdf; 931 931 } 932 932 933 /*.expanded #adminmenu li.wp-not-current-submenu:hover a.menu-top, 934 .expanded #adminmenu li.wp-not-current-submenu:hover .wp-menu-arrow { */ 935 /* background-color: #bbb; /* Fallback */ 936 /* background-image: -ms-linear-gradient(bottom, #aaa, #ccc); /* IE10 */ 937 /* background-image: -moz-linear-gradient(bottom, #aaa, #ccc); /* Firefox */ 938 /* background-image: -o-linear-gradient(bottom, #aaa, #ccc); /* Opera */ 939 /* background-image: -webkit-gradient(linear, left bottom, left top, from(#aaa), to(#ccc)); /* old Webkit */ 940 /* background-image: -webkit-linear-gradient(bottom, #aaa, #ccc); /* new Webkit */ 941 /* background-image: linear-gradient(bottom, #aaa, #ccc); /* proposed W3C Markup */ 942 /* border-top-color: #ccc; 943 border-bottom-color: #aaa; 944 color: #333; 945 }*/ 946 947 .expanded #adminmenu li.wp-not-current-submenu:hover a.menu-top, 948 .expanded #adminmenu li.wp-not-current-submenu:hover .wp-menu-arrow { 949 background-color: #eaf2fa; /* Fallback */ 950 background-image: -ms-linear-gradient(bottom, #aaa, #f8fafd); /* IE10 */ 951 background-image: -moz-linear-gradient(bottom, #aaa, #f8fafd); /* Firefox */ 952 background-image: -o-linear-gradient(bottom, #aaa, #ccc); /* Opera */ 953 background-image: -webkit-gradient(linear, left bottom, left top, from(#aaa), to(#ccc)); /* old Webkit */ 954 background-image: -webkit-linear-gradient(bottom, #cfe1f3, #eaf2fa); /* new Webkit */ 955 background-image: linear-gradient(bottom, #aaa, #ccc); /* proposed W3C Markup */ 956 border-top-color: #eaf2fa; 957 border-bottom-color: #cfe1f3; 958 color: #333; 959 } 960 933 961 #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, 934 962 #adminmenu li.current a.menu-top, 935 963 .folded #adminmenu li.wp-has-current-submenu, 936 964 .folded #adminmenu li.current.menu-top, 937 #adminmenu .wp-menu-arrow, 965 #adminmenu .wp-has-current-submenu .wp-menu-arrow, 966 #adminmenu .current .wp-menu-arrow, 938 967 #adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head { 939 968 background-color: #777; /* Fallback */ 940 969 background-image: -ms-linear-gradient(bottom, #6d6d6d, #808080); /* IE10 */ … … 945 974 background-image: linear-gradient(bottom, #6d6d6d, #808080); /* proposed W3C Markup */ 946 975 } 947 976 977 .expanded #adminmenu li.wp-not-current-submenu li:hover a { 978 background-color: #eaf2fa; /* Fallback */ 979 background-image: -ms-linear-gradient(left, #aaa, #f8fafd); /* IE10 */ 980 background-image: -moz-linear-gradient(left, #aaa, #f8fafd); /* Firefox */ 981 background-image: -o-linear-gradient(left, #aaa, #ccc); /* Opera */ 982 background-image: -webkit-gradient(linear, left bottom, right bottom, from(#aaa), to(#ccc)); /* old Webkit */ 983 background-image: -webkit-linear-gradient(left, white, #eaf2fa 30px); /* new Webkit */ 984 background-image: linear-gradient(left, #aaa, #ccc); /* proposed W3C Markup */ 985 } 986 948 987 #adminmenu li.wp-has-current-submenu a.wp-has-current-submenu, 949 988 #adminmenu li.current a.menu-top, 950 989 #adminmenu .wp-has-current-submenu .wp-submenu .wp-submenu-head { … … 975 1014 background-color: #fff; 976 1015 } 977 1016 978 .folded#adminmenu .wp-submenu-wrap,979 .folded#adminmenu .wp-submenu ul {1017 #adminmenu .wp-submenu-wrap, 1018 #adminmenu .wp-submenu ul { 980 1019 border-color: #dfdfdf; 981 1020 } 982 1021 983 .folded#adminmenu .wp-submenu-wrap {1022 #adminmenu .wp-submenu-wrap { 984 1023 -moz-box-shadow: 2px 2px 5px rgba( 0, 0, 0, 0.4 ); 985 1024 -webkit-box-shadow: 2px 2px 5px rgba( 0, 0, 0, 0.4 ); 986 1025 box-shadow: 2px 2px 5px rgba( 0, 0, 0, 0.4 ); -
wp-admin/css/wp-admin.dev.css
1096 1096 } 1097 1097 1098 1098 #adminmenu .wp-submenu { 1099 display: none;1100 1099 list-style: none; 1101 1100 padding: 0; 1102 1101 margin: 0; 1102 overflow: hidden; 1103 1104 } 1105 1106 #adminmenu .wp-not-current-submenu .wp-submenu, 1107 .folded #adminmenu .wp-has-current-submenu .wp-submenu { 1108 display: block; 1109 position: absolute; 1110 top: -1px; 1111 left: 146px; 1112 z-index: 999; 1113 width: 0; 1114 overflow: hidden; 1115 -moz-transition: width 200ms ease-out; 1116 -webkit-transition: width 200ms ease-out; 1117 -o-transition: width 200ms ease-out; 1118 transition: width 200ms ease-out; 1119 } 1120 1121 .expanded #adminmenu .wp-has-current-submenu .wp-submenu { 1103 1122 position: relative; 1104 1123 z-index: 2; 1124 width: 145px; 1125 top: auto; 1126 left: auto; 1127 right: auto; 1128 bottom: auto; 1129 padding: 0; 1105 1130 } 1106 1131 1132 .expanded #adminmenu .wp-has-current-submenu .wp-submenu-wrap { 1133 -moz-box-shadow: none; 1134 -webkit-box-shadow: none; 1135 box-shadow: none; 1136 } 1137 1138 .js.folded #adminmenu .wp-submenu { 1139 top: -5px; 1140 left: 26px; 1141 } 1142 .js #adminmenu .wp-submenu.sub-open { 1143 padding: 0 8px 8px 0; 1144 } 1145 1146 /*.js.folded #adminmenu .wp-has-current-submenu .wp-submenu { 1147 width: 0; 1148 }*/ 1149 1150 1107 1151 #adminmenu .wp-submenu a { 1108 1152 font-size: 12px; 1109 1153 line-height: 18px; … … 1186 1230 padding-left: 12px; 1187 1231 } 1188 1232 1233 .expanded #adminmenu li.wp-not-current-submenu li { 1234 margin-left: 6px; 1235 } 1236 1237 .expanded #adminmenu li.wp-not-current-submenu li a { 1238 padding-left: 16px; 1239 } 1240 1189 1241 .wp-menu-arrow { 1190 1242 display: none; 1191 1243 } 1192 1244 #adminmenu li.wp-has-current-submenu .wp-menu-arrow, 1193 #adminmenu li.menu-top.current .wp-menu-arrow { 1245 #adminmenu li.menu-top.current .wp-menu-arrow, 1246 .expanded #adminmenu li.menu-top:hover .wp-menu-arrow { 1194 1247 display: block; 1195 1248 position: absolute; 1196 1249 right: -9px; … … 1198 1251 cursor: auto; 1199 1252 z-index: 25; 1200 1253 } 1254 1255 .expanded #adminmenu li.menu-top:hover .wp-menu-arrow { 1256 z-index: 1500; 1257 } 1258 1201 1259 #adminmenu .wp-menu-arrow div { 1202 1260 width: 15px; 1203 1261 height: 30px; … … 1245 1303 border-style: solid; 1246 1304 } 1247 1305 1248 .js.folded #adminmenu .wp-submenu {1249 display: block;1250 position: absolute;1251 top: -5px;1252 left: 26px;1253 z-index: 999;1254 width: 0;1255 padding: 0;1256 overflow: hidden;1257 -moz-transition: width 200ms ease-out;1258 -webkit-transition: width 200ms ease-out;1259 -o-transition: width 200ms ease-out;1260 transition: width 200ms ease-out;1261 }1262 .js.folded #adminmenu .wp-submenu.sub-open {1263 padding: 0 8px 8px 0;1264 }1265 1266 1306 #adminmenu .wp-submenu .wp-submenu-head { 1267 1307 padding: 6px 4px 5px 10px; 1268 1308 cursor: default; … … 1270 1310 border-style: solid; 1271 1311 } 1272 1312 1273 .js.folded #adminmenu .wp-submenu-wrap { 1274 margin-top: 4px; 1275 border-width: 0 1px 1px 0; 1313 .js #adminmenu .wp-not-current-submenu .wp-submenu-wrap { 1314 border-width: 1px 1px 1px 0; 1276 1315 border-style: solid; 1277 1316 position: relative; 1278 1317 -webkit-border-bottom-right-radius: 3px; … … 1285 1324 border-top-right-radius: 3px; 1286 1325 } 1287 1326 1327 .js.folded #adminmenu .wp-submenu .wp-submenu-wrap { 1328 margin-top: 4px; 1329 border-width: 0 1px 1px 0; 1330 } 1331 1288 1332 .js.folded #adminmenu .wp-submenu ul { 1289 1333 border-width: 0 0 0 1px; 1290 1334 border-style: solid;