| | 664 | |
| | 665 | // Align theme browser thickbox |
| | 666 | var tb_position; |
| | 667 | jQuery(document).ready( function($) { |
| | 668 | tb_position = function() { |
| | 669 | var tbWindow = $('#TB_window'), |
| | 670 | width = $(window).width(), |
| | 671 | H = $(window).height(), |
| | 672 | W = ( 1040 < width ) ? 1040 : width, |
| | 673 | adminbar_height = 0; |
| | 674 | |
| | 675 | if ( $('body.admin-bar').length ) { |
| | 676 | adminbar_height = 32; |
| | 677 | } |
| | 678 | |
| | 679 | if ( tbWindow.size() ) { |
| | 680 | tbWindow.width( W - 50 ).height( H - 45 - adminbar_height ); |
| | 681 | $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height ); |
| | 682 | tbWindow.css({'margin-left': '-' + parseInt( ( ( W - 50 ) / 2 ), 10 ) + 'px'}); |
| | 683 | if ( typeof document.body.style.maxWidth != 'undefined' ) |
| | 684 | tbWindow.css({'top': 20 + adminbar_height + 'px', 'margin-top': '0'}); |
| | 685 | }; |
| | 686 | }; |
| | 687 | |
| | 688 | $(window).resize( function() { |
| | 689 | tb_position(); |
| | 690 | }); |
| | 691 | }); |