Sliding tabs for the nav menu admin UI. second pass. props koopersmith, see #13215.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-05-03 16:59:51 +00:00
parent 70aa9e12eb
commit 0c2e93aee7
5 changed files with 23 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@ -135,9 +135,9 @@ body {
overflow: hidden;
}
.no-js #menu-management .nav-tabs {
#menu-management .nav-tabs {
padding-left: 30px;
clear: both;
padding-right: 10px;
}
.js #menu-management .nav-tabs {
float: left;

View File

@ -426,18 +426,29 @@ var WPNavMenuHandler = function ($) {
}
});
// Find the width of all tabs
tabs.each(function(){
tabsWidth += $(this).outerWidth(true);
});
// Check if we need the tab manager
if( tabsWidth <= fixed.width()
- fluid.css('padding-left').slice(0,-2)
- fluid.css('padding-right').slice(0,-2) )
return;
// Set up right margin for overflow, unset padding
fluid.css({
'margin-right' : (-1 * tabsWidth) + 'px',
'padding' : 0,
});
// Build tab navigation
arrowLeft = $('<div class="nav-tabs-arrow nav-tabs-arrow-left"><a>&laquo;</a></div>');
arrowRight = $('<div class="nav-tabs-arrow nav-tabs-arrow-right"><a>&raquo;</a></div>');
// Attach to the document
fixed.wrap('<div class="nav-tabs-nav"/>').parent().prepend( arrowLeft ).append( arrowRight );
// Set up right margin
tabs.each(function(){
tabsWidth += $(this).outerWidth(true);
});
fluid.css('margin-right', (-1 * tabsWidth) + 'px');
// Set the menu tabs
resetMenuTabs();
// Make sure the tabs reset on resize

File diff suppressed because one or more lines are too long

View File

@ -393,7 +393,7 @@ function wp_default_scripts( &$scripts ) {
) );
// Custom Navigation
$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100503' );
$scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", false, '20100503a' );
$scripts->localize( 'nav-menu', 'navMenuL10n', array(
'custom' => _x('Custom', 'menu nav item type'),
'thickbox' => _x('Edit Menu Item', 'Thickbox Title'),
@ -474,7 +474,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'farbtastic', '/wp-admin/css/farbtastic.css', array(), '1.2' );
$styles->add( 'jcrop', '/wp-includes/js/jcrop/jquery.Jcrop.css', array(), '0.9.8' );
$styles->add( 'imgareaselect', '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.1' );
$styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100503' );
$styles->add( 'nav-menu', "/wp-admin/css/nav-menu$suffix.css", array(), '20100503a' );
foreach ( $rtl_styles as $rtl_style ) {
$styles->add_data( $rtl_style, 'rtl', true );