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: https://develop.svn.wordpress.org/trunk@7989 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-05-24 17:06:26 +00:00
parent 8925593aea
commit 44084888b7
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; <?php endif;
if ( isset($page_hook) ) { if ( isset($page_hook) ) {
do_action('admin_print_scripts-' . $page_hook);
do_action('admin_print_styles-' . $page_hook); do_action('admin_print_styles-' . $page_hook);
do_action('admin_print_scripts-' . $page_hook);
do_action('admin_head-' . $page_hook); do_action('admin_head-' . $page_hook);
} else if ( isset($plugin_page) ) { } else if ( isset($plugin_page) ) {
do_action('admin_print_scripts-' . $plugin_page);
do_action('admin_print_styles-' . $plugin_page); do_action('admin_print_styles-' . $plugin_page);
do_action('admin_print_scripts-' . $plugin_page);
do_action('admin_head-' . $plugin_page); do_action('admin_head-' . $plugin_page);
} else if ( isset($pagenow) ) { } else if ( isset($pagenow) ) {
do_action('admin_print_scripts-' . $pagenow);
do_action('admin_print_styles-' . $pagenow); do_action('admin_print_styles-' . $pagenow);
do_action('admin_print_scripts-' . $pagenow);
do_action('admin_head-' . $pagenow); do_action('admin_head-' . $pagenow);
} }
do_action('admin_print_scripts');
do_action('admin_print_styles'); do_action('admin_print_styles');
do_action('admin_print_scripts');
do_action('admin_head'); do_action('admin_head');
?> ?>

View File

@ -21,10 +21,10 @@ jQuery(function($) {
if ( tbWindow.size() ) { if ( tbWindow.size() ) {
tbWindow.width( W - 50 ).height( H - 45 ); tbWindow.width( W - 50 ).height( H - 45 );
$('#TB_iframeContent').width( W - 50 ).height( H - 75 ); $('#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'}); $('#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() { return $('a.thickbox').each( function() {
@ -37,6 +37,5 @@ jQuery(function($) {
}; };
$(window).resize( function() { tb_position() } ); $(window).resize( function() { tb_position() } );
$(document).ready( function() { tb_position() } );
}); });

View File

@ -9,11 +9,11 @@ jQuery(function($) {
var W = $(window).width(); var W = $(window).width();
if ( tbWindow.size() ) { if ( tbWindow.size() ) {
tbWindow.width( W - 100 ).height( H - 60 ); tbWindow.width( W - 90 ).height( H - 60 );
$('#TB_iframeContent').width( W - 100 ).height( H - 90 ); $('#TB_iframeContent').width( W - 90 ).height( H - 90 );
tbWindow.css({'margin-left': '-' + parseInt((( W - 100 ) / 2),10) + 'px','top':'30px','margin-top':'0'}); tbWindow.css({'margin-left': '-' + parseInt((( W - 90 ) / 2),10) + 'px'});
if ( $.browser.msie && $.browser.version.substr(0,1) < 7 ) if ( ! ( $.browser.msie && $.browser.version.substr(0,1) < 7 ) )
tbWindow.css({'margin-top':document.documentElement.scrollTop+'px'}); tbWindow.css({'top':'30px','margin-top':'0'});
}; };
return $('a.thickbox').each( function() { return $('a.thickbox').each( function() {
@ -21,7 +21,7 @@ jQuery(function($) {
if ( ! href ) return; if ( ! href ) return;
href = href.replace(/&width=[0-9]+/g, ''); href = href.replace(/&width=[0-9]+/g, '');
href = href.replace(/&height=[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'), 'edit' => __('Edit'),
) ); ) );
$scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080520' ); $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( $scripts->localize( 'upload', 'uploadL10n', array(
'browseTitle' => attribute_escape(__('Browse your files')), 'browseTitle' => attribute_escape(__('Browse your files')),
'back' => __('&laquo; Back'), 'back' => __('&laquo; Back'),
@ -199,7 +199,7 @@ function wp_default_scripts( &$scripts ) {
'error' => __('Error:') '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' );
} }
} }