Remove the other tab before sliding down.

git-svn-id: http://svn.automattic.com/wordpress/trunk@9561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-11-07 22:07:58 +00:00
parent 73959104bc
commit c295b4b8e8
2 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,8 @@
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
$('#show-settings-link').click(function () { $('#show-settings-link').click(function () {
if ( ! $('#screen-options-wrap').hasClass('screen-options-open') ) {
$('#contextual-help-link-wrap').addClass('invisible');
}
$('#screen-options-wrap').slideToggle('fast', function(){ $('#screen-options-wrap').slideToggle('fast', function(){
if ( $(this).hasClass('screen-options-open') ) { if ( $(this).hasClass('screen-options-open') ) {
$('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif")'}); $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right.gif")'});
@ -8,13 +11,15 @@ jQuery(document).ready( function($) {
} else { } else {
$('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'}); $('#show-settings-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'});
$('#contextual-help-link-wrap').addClass('invisible');
$(this).addClass('screen-options-open'); $(this).addClass('screen-options-open');
} }
}); });
return false; return false;
}).parent(); }).parent();
$('#contextual-help-link').click(function () { $('#contextual-help-link').click(function () {
if ( ! $('#contextual-help-wrap').hasClass('contextual-help-open') ) {
$('#screen-options-link-wrap').addClass('invisible');
}
$('#contextual-help-wrap').slideToggle('fast', function(){ $('#contextual-help-wrap').slideToggle('fast', function(){
if ( $(this).hasClass('contextual-help-open') ) { if ( $(this).hasClass('contextual-help-open') ) {
$('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right.gif")'}); $('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right.gif")'});
@ -22,7 +27,6 @@ jQuery(document).ready( function($) {
$(this).removeClass('contextual-help-open'); $(this).removeClass('contextual-help-open');
} else { } else {
$('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'}); $('#contextual-help-link').css({'backgroundImage':'url("images/screen-options-right-up.gif")'});
$('#screen-options-link-wrap').addClass('invisible');
$(this).addClass('contextual-help-open'); $(this).addClass('contextual-help-open');
} }
}); });

View File

@ -292,7 +292,7 @@ function wp_default_scripts( &$scripts ) {
'requestFile' => admin_url('admin-ajax.php'), 'requestFile' => admin_url('admin-ajax.php'),
) ); ) );
$scripts->add( 'settings-box', '/wp-admin/js/settings-box.js', array( 'jquery' ), '20081105' ); $scripts->add( 'settings-box', '/wp-admin/js/settings-box.js', array( 'jquery' ), '20081107' );
$scripts->add( 'dashboard', '/wp-admin/js/dashboard.js', array( 'jquery', 'admin-comments', 'postbox', 'settings-box' ), '20081016' ); $scripts->add( 'dashboard', '/wp-admin/js/dashboard.js', array( 'jquery', 'admin-comments', 'postbox', 'settings-box' ), '20081016' );