Ticket #8612: menu.diff
| File menu.diff, 4.4 KB (added by , 18 years ago) |
|---|
-
wp-admin/includes/template.php
3318 3318 $show_screen = true; 3319 3319 ?> 3320 3320 <div id="screen-meta"> 3321 <div id="screen-options-wrap" class="hidden"> 3322 <h5><?php _e('Menu Comfort'); ?></h5> 3323 <form id="adv-settings" action="" method="get"> 3324 <div class="metabox-prefs"> 3325 <label for="mstate"> 3326 <input name="mstate" type="checkbox" class="msetting" id="mstate" />Forget state on reload</label> 3327 <label for="mhov"> 3328 <input name="mhov" type="checkbox" class="msetting" id="mhov" /><?php _e("Don't expand on hover") ?></label> 3329 <br class="clear" /> 3330 </div> 3331 </form> 3321 3332 <?php 3322 3333 if ( $show_screen ) : 3323 3334 ?> 3324 <div id="screen-options-wrap" class="hidden">3325 3335 <h5><?php _e('Show on screen') ?></h5> 3326 3336 <form id="adv-settings" action="" method="get"> 3327 3337 <div class="metabox-prefs"> … … 3333 3343 ?> 3334 3344 <br class="clear" /> 3335 3345 </div></form> 3346 <?php 3347 endif; 3348 ?> 3336 3349 </div> 3337 3350 3338 3351 <?php 3339 endif;3340 3352 3341 3353 global $title; 3342 3354 -
wp-admin/js/common.js
156 156 $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif")'}); 157 157 $('#contextual-help-link-wrap').removeClass('invisible'); 158 158 $(this).removeClass('screen-options-open'); 159 160 159 } else { 161 160 $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'}); 162 161 $(this).addClass('screen-options-open'); … … 183 182 return false; 184 183 }); 185 184 185 // menu options 186 $('.msetting').each( function() { 187 $(this).click(function(){setUserSetting($(this).attr('id'),($(this).attr("checked")==true)?'n':'y');}) 188 .attr("checked",(getUserSetting($(this).attr('id'))=='n')?true:false); 189 }); 190 191 $('#adminmenu li.wp-has-submenu').hoverIntent(adminMenu.hoverSettings); 192 186 193 // check all checkboxes 187 194 var lastClicked = false; 188 195 $( 'table:visible tbody .check-column :checkbox' ).click( function(e) { … … 278 285 279 286 restoreMenuState : function() { 280 287 $('#adminmenu li.wp-has-submenu').each(function(i, e) { 288 if( 'n' == getUserSetting( 'mstate' ) ){ 289 if($(e).hasClass('wp-has-current-submenu')) 290 $(e).addClass('pinned'); 291 else 292 $(e).removeClass('wp-menu-open'); 293 return true; 294 } 281 295 var v = getUserSetting( 'm'+i ); 282 if ( $(e).hasClass('wp-has-current-submenu') ) return true; // leave the current parent open 296 if ( $(e).hasClass('wp-has-current-submenu') ) { 297 $(e).addClass('pinned'); return true; 298 } // leave the current parent open 283 299 284 300 if ( 'o' == v ) $(e).addClass('wp-menu-open'); 285 301 else if ( 'c' == v ) $(e).removeClass('wp-menu-open'); … … 287 303 }, 288 304 289 305 toggle : function(el) { 306 if(getUserSetting('mhov')=='n') { 307 var effect=(el.parent().hasClass('pinned'))?'slideUp':'slideDown'; 308 el[effect](150, function(){el.css({'display':''});}).parent() 309 .toggleClass('wp-menu-open').toggleClass('pinned'); 310 } 311 else 312 el.parent().toggleClass('pinned'); 290 313 291 el['slideToggle'](150, function(){el.css('display','');}).parent().toggleClass( 'wp-menu-open' );292 293 314 $('#adminmenu li.wp-has-submenu').each(function(i, e) { 294 var v = $(e).hasClass(' wp-menu-open') ? 'o' : 'c';315 var v = $(e).hasClass('pinned') ? 'o' : 'c'; 295 316 setUserSetting( 'm'+i, v ); 296 317 }); 297 318 298 319 return false; 299 320 }, 300 321 322 hover : function(el,act) { 323 if(getUserSetting('mhov')=='n') return true; 324 var eff='',tog=''; 325 if(el.parent().hasClass('pinned')) 326 if(el.parent().hasClass('wp-menu-open')) return true; 327 else {eff='slideDown';tog='addClass';} 328 if(act=='hide'){eff='slideUp';tog='removeClass';} //wierd fix 329 el[(eff)?eff:'slideToggle'](300, function(){el.css({'display':''});}) 330 .parent()[(tog)?tog:'toggleClass']('wp-menu-open'); 331 }, 332 333 hoverSettings :{ 334 over: function(e){ 335 adminMenu.hover( $(this).find('.wp-submenu') ,"show" ); 336 }, 337 out: function(e){ 338 adminMenu.hover( $(this).find('.wp-submenu'), "hide" ); 339 }, 340 timeout: 10, //match toggle time 341 sensitivity: 8, 342 interval: 200 343 }, 344 301 345 fold : function(off) { 302 346 if (off) { 303 347 $('#wpcontent').removeClass('folded'); 304 348 $('#adminmenu li.wp-has-submenu').unbind(); 349 $('#adminmenu li.wp-has-submenu').hoverIntent(adminMenu.hoverSettings); 305 350 } else { 306 351 $('#wpcontent').addClass('folded'); 307 352 $('#adminmenu li.wp-has-submenu').hoverIntent({
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)