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

git-svn-id: http://svn.automattic.com/wordpress/trunk@20387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2012-04-06 21:40:57 +00:00
parent 2c87af1983
commit 810a02cc4c
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');