mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-21 22:15:28 +00:00
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: http://svn.automattic.com/wordpress/trunk@12349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ab2d609404
commit
cf60d7c87a
@ -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
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user