Do not auto-scroll the media popup when opening an image details section if it can fit in the viewport, props caesarsgrunt, fixes #11269

git-svn-id: https://develop.svn.wordpress.org/trunk@12349 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-12-09 12:24:45 +00:00
parent daa0430927
commit 30d99c2c6e
3 changed files with 13 additions and 5 deletions

View File

@ -65,8 +65,16 @@ function prepareMediaItemInit(fileObj) {
// Also bind toggle to the links
jQuery('a.toggle', item).click(function(){
jQuery(this).siblings('.slidetoggle').slideToggle(350, function(){
var o = jQuery(this).offset();
window.scrollTo(0, o.top - 36);
var w = jQuery(window).height(), t = jQuery(this).offset().top, h = jQuery(this).height(), b;
if ( w && t && h ) {
b = t + h;
if ( b > w && (h + 48) < w )
window.scrollBy(0, b - w + 13);
else if ( b > w )
window.scrollTo(0, t - 36);
}
});
jQuery(this).siblings('.toggle').andSelf().toggle();
jQuery(this).siblings('a.toggle').focus();
@ -161,7 +169,7 @@ function deleteSuccess(data, textStatus) {
jQuery('.filename', item).append('<span class="trashnotice"> ' + swfuploadL10n.deleted + ' </span>').siblings('a.toggle').hide();
jQuery('.filename', item).append( jQuery('a.undo', item).removeClass('hidden') );
jQuery('.menu_order_input', item).hide();
return;
}

File diff suppressed because one or more lines are too long

View File

@ -193,7 +193,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'swfupload-all', '/wp-includes/js/swfupload/swfupload-all.js', array(), '2201');
}
$scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20091128');
$scripts->add( 'swfupload-handlers', "/wp-includes/js/swfupload/handlers$suffix.js", array('swfupload-all', 'jquery'), '2201-20091208');
$max_upload_size = ( (int) ( $max_up = @ini_get('upload_max_filesize') ) < (int) ( $max_post = @ini_get('post_max_size') ) ) ? $max_up : $max_post;
if ( empty($max_upload_size) )
$max_upload_size = __('not configured');