Make WordPress Core

Ticket #13335: navmenu.17732.diff

File navmenu.17732.diff, 2.2 KB (added by edward mindreantre, 16 years ago)
  • wp-admin/css/nav-menu.dev.css

     
    131131                left: 0;
    132132        }
    133133        #menu-management .nav-tabs-arrow-right {
    134                 right: 0;
     134                right: 50px;
    135135                text-align: right;
    136136        }
    137137
  • wp-admin/js/nav-menu.dev.js

     
    693693                                marginFluid = api.isRTL ? 'margin-right' : 'margin-left',
    694694                                marginFixed = api.isRTL ? 'margin-left' : 'margin-right',
    695695                                msPerPx = 2;
    696 
     696                               
    697697                        /**
    698698                         * Refreshes the menu tabs.
    699699                         * Will show and hide arrows where necessary.
     
    721721
    722722                                // Show the arrows only when necessary
    723723                                if( fixedWidth > tabsWidth )
     724                                {
     725                                        // If the tabs have been scrolled and the arrows disappear, scroll to the beginning of the tabs.
     726                                        css[marginFluid] = '0px';
     727                                        fluid.animate( css, 100, "linear" );
    724728                                        arrowLeft.add( arrowRight ).hide();
     729                                }
    725730                                else
    726731                                        arrowLeft.add( arrowRight ).show();
    727732                        }
    728733
    729734                        $.fn.extend({
    730735                                makeTabVisible : function() {
     736                                        // Don't try to make the menu-add-new tab visible since it's always visible.
     737                                        if (this.hasClass('menu-add-new'))
     738                                                return;
    731739                                        var t = this.eq(0), left, right, css = {}, shift = 0;
    732740
    733741                                        if( ! t.length ) return this;
     
    756764
    757765                        // Find the width of all tabs
    758766                        tabs.each(function(){
    759                                 tabsWidth += $(this).outerWidth(true);
     767                                if ( !$(this).hasClass('menu-add-new'))
     768                                {
     769                                        tabsWidth += $(this).outerWidth(true);
     770                                }
    760771                        });
    761772
    762773                        // Set up fixed margin for overflow, unset padding
     
    769780                        arrowRight = $('<div class="nav-tabs-arrow nav-tabs-arrow-right"><a>&raquo;</a></div>');
    770781                        // Attach to the document
    771782                        fixed.wrap('<div class="nav-tabs-nav"/>').parent().prepend( arrowLeft ).append( arrowRight );
     783                        $('.nav-tabs-nav').css({'margin-right' : '70px'});
     784                        $('.menu-add-new')
     785                                .css({
     786                                        'position' : 'absolute',
     787                                        'top' : 0,
     788                                        'right' : 0
     789                                });
    772790
    773791                        // Set the menu tabs
    774792                        api.refreshMenuTabs();