Reset negative top margin on submenus when folding/unfolding the admin menu, fixes #20380

git-svn-id: https://develop.svn.wordpress.org/trunk@20387 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2012-04-06 21:40:57 +00:00
parent 9b766fa0b8
commit a55be0ba27
1 changed files with 6 additions and 3 deletions

View File

@ -172,6 +172,9 @@ $(document).ready( function() {
$('#collapse-menu', menu).click(function(){
var body = $(document.body);
// reset any compensation for submenus near the bottom of the screen
$('#adminmenu div.wp-submenu').css('margin-top', '');
if ( body.hasClass('folded') ) {
body.removeClass('folded');
setUserSetting('mfold', 'o');
@ -205,9 +208,9 @@ $(document).ready( function() {
o = maxtop;
if ( o > 1 )
m.css({'marginTop':'-'+o+'px'});
else if ( m.css('marginTop') )
m.css({'marginTop':''});
m.css('margin-top', '-'+o+'px');
else
m.css('margin-top', '');
menu.find('.wp-submenu').removeClass('sub-open');
m.addClass('sub-open');