Fix submenu position and state on folded admin menu, props sambauers, fixes #9956

git-svn-id: https://develop.svn.wordpress.org/trunk@11483 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-05-29 07:42:55 +00:00
parent 5fc6d253b4
commit d36df6430d
3 changed files with 13 additions and 8 deletions
+11 -6
View File
@@ -26,9 +26,8 @@ adminMenu = {
if ( $('body').hasClass('folded') ) {
this.fold();
} else {
this.restoreMenuState();
}
this.restoreMenuState();
},
restoreMenuState : function() {
@@ -61,10 +60,16 @@ adminMenu = {
$('body').addClass('folded');
$('#adminmenu li.wp-has-submenu').hoverIntent({
over: function(e){
var m = $(this).find('.wp-submenu'), t = e.clientY, H = $(window).height(), h = m.height(), o;
if ( (t+h+10) > H ) {
o = (t+h+10) - H;
var m, b, h, o, f;
m = $(this).find('.wp-submenu');
b = m.parent().offset().top + m.height() + 1; // Bottom offset of the menu
h = $('#wpwrap').height(); // Height of the entire page
o = 60 + b - h;
f = $(window).height() + $('body').scrollTop() - 15; // The fold
if (f < (b - o)) {
o = b - f;
}
if (o > 1) {
m.css({'marginTop':'-'+o+'px'});
} else if ( m.css('marginTop') ) {
m.css({'marginTop':''});