Make WordPress Core


Ignore:
Timestamp:
05/29/2009 07:42:55 AM (15 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/common.dev.js

    r11450 r11483  
    2727        if ( $('body').hasClass('folded') ) {
    2828            this.fold();
    29         } else {
    30             this.restoreMenuState();
    31         }
     29        }
     30        this.restoreMenuState();
    3231    },
    3332
     
    6261            $('#adminmenu li.wp-has-submenu').hoverIntent({
    6362                over: function(e){
    64                     var m = $(this).find('.wp-submenu'), t = e.clientY, H = $(window).height(), h = m.height(), o;
    65 
    66                     if ( (t+h+10) > H ) {
    67                         o = (t+h+10) - H;
     63                    var m, b, h, o, f;
     64                    m = $(this).find('.wp-submenu');
     65                    b = m.parent().offset().top + m.height() + 1; // Bottom offset of the menu
     66                    h = $('#wpwrap').height(); // Height of the entire page
     67                    o = 60 + b - h;
     68                    f = $(window).height() + $('body').scrollTop() - 15; // The fold
     69                    if (f < (b - o)) {
     70                        o = b - f;
     71                    }
     72                    if (o > 1) {
    6873                        m.css({'marginTop':'-'+o+'px'});
    6974                    } else if ( m.css('marginTop') ) {
Note: See TracChangeset for help on using the changeset viewer.