Fixes timing issue in IE6 in the TB mod scripts. Reorders css files to load before js in the admin head. Props azaozz. fixes #7032

git-svn-id: http://svn.automattic.com/wordpress/trunk@7989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-05-24 17:06:26 +00:00
parent b70d3b2028
commit fba6b2415c
4 changed files with 15 additions and 16 deletions

View File

@ -46,20 +46,20 @@ addLoadEvent = function(func) {if (typeof jQuery != "undefined") jQuery(document
<?php endif;
if ( isset($page_hook) ) {
do_action('admin_print_scripts-' . $page_hook);
do_action('admin_print_styles-' . $page_hook);
do_action('admin_print_scripts-' . $page_hook);
do_action('admin_head-' . $page_hook);
} else if ( isset($plugin_page) ) {
do_action('admin_print_scripts-' . $plugin_page);
do_action('admin_print_styles-' . $plugin_page);
do_action('admin_print_scripts-' . $plugin_page);
do_action('admin_head-' . $plugin_page);
} else if ( isset($pagenow) ) {
do_action('admin_print_scripts-' . $pagenow);
do_action('admin_print_styles-' . $pagenow);
do_action('admin_print_scripts-' . $pagenow);
do_action('admin_head-' . $pagenow);
}
do_action('admin_print_scripts');
do_action('admin_print_styles');
do_action('admin_print_scripts');
do_action('admin_head');
?>

View File

@ -21,10 +21,10 @@ jQuery(function($) {
if ( tbWindow.size() ) {
tbWindow.width( W - 50 ).height( H - 45 );
$('#TB_iframeContent').width( W - 50 ).height( H - 75 );
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px','top':'20px','margin-top':'0'});
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 ) )
tbWindow.css({'top':'20px','margin-top':'0'});
$('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
if ( $.browser.msie && $.browser.version.substr(0,1) < 7 )
tbWindow.css({'margin-top':document.documentElement.scrollTop+'px'});
};
return $('a.thickbox').each( function() {
@ -37,6 +37,5 @@ jQuery(function($) {
};
$(window).resize( function() { tb_position() } );
$(document).ready( function() { tb_position() } );
});

View File

@ -9,11 +9,11 @@ jQuery(function($) {
var W = $(window).width();
if ( tbWindow.size() ) {
tbWindow.width( W - 100 ).height( H - 60 );
$('#TB_iframeContent').width( W - 100 ).height( H - 90 );
tbWindow.css({'margin-left': '-' + parseInt((( W - 100 ) / 2),10) + 'px','top':'30px','margin-top':'0'});
if ( $.browser.msie && $.browser.version.substr(0,1) < 7 )
tbWindow.css({'margin-top':document.documentElement.scrollTop+'px'});
tbWindow.width( W - 90 ).height( H - 60 );
$('#TB_iframeContent').width( W - 90 ).height( H - 90 );
tbWindow.css({'margin-left': '-' + parseInt((( W - 90 ) / 2),10) + 'px'});
if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 ) )
tbWindow.css({'top':'30px','margin-top':'0'});
};
return $('a.thickbox').each( function() {
@ -21,7 +21,7 @@ jQuery(function($) {
if ( ! href ) return;
href = href.replace(/&width=[0-9]+/g, '');
href = href.replace(/&height=[0-9]+/g, '');
$(this).attr( 'href', href + '&width=' + ( W - 100 ) + '&height=' + ( H - 100 ) );
$(this).attr( 'href', href + '&width=' + ( W - 110 ) + '&height=' + ( H - 100 ) );
});
};

View File

@ -158,7 +158,7 @@ function wp_default_scripts( &$scripts ) {
'edit' => __('Edit'),
) );
$scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080520' );
$scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080430' );
$scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080523' );
$scripts->localize( 'upload', 'uploadL10n', array(
'browseTitle' => attribute_escape(__('Browse your files')),
'back' => __('&laquo; Back'),
@ -199,7 +199,7 @@ function wp_default_scripts( &$scripts ) {
'error' => __('Error:')
));
$scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'dimensions' ), '20080515' );
$scripts->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'dimensions' ), '20080523' );
}
}