Make WordPress Core

Ticket #26140: 26140.2.patch

File 26140.2.patch, 5.1 KB (added by SergeyBiryukov, 11 years ago)
  • src/wp-admin/js/media-upload.js

     
    5050var tb_position;
    5151(function($) {
    5252        tb_position = function() {
    53                 var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0;
     53                var tbWindow = $('#TB_window'),
     54                        width = $(window).width(),
     55                        H = $(window).height(),
     56                        W = ( 720 < width ) ? 720 : width,
     57                        adminbar_height = 0;
    5458
    55                 if ( $('body.admin-bar').length )
    56                         adminbar_height = 28;
     59                if ( $('body.admin-bar').length ) {
     60                        adminbar_height = parseInt( jQuery('#wpadminbar').css('height'), 10 );
     61                }
    5762
    5863                if ( tbWindow.size() ) {
    5964                        tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
    6065                        $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
    61                         tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
    62                         if ( typeof document.body.style.maxWidth != 'undefined' )
    63                                 tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
     66                        tbWindow.css({'margin-left': '-' + parseInt( ( ( W - 50 ) / 2 ), 10 ) + 'px'});
     67                        if ( typeof document.body.style.maxWidth !== 'undefined' )
     68                                tbWindow.css({'top': 20 + adminbar_height + 'px', 'margin-top': '0'});
    6469                }
    6570
    6671                return $('a.thickbox').each( function() {
  • src/wp-admin/js/plugin-install.js

     
    44var tb_position;
    55jQuery(document).ready(function($) {
    66        tb_position = function() {
    7                 var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0;
     7                var tbWindow = $('#TB_window'),
     8                        width = $(window).width(),
     9                        H = $(window).height(),
     10                        W = ( 720 < width ) ? 720 : width,
     11                        adminbar_height = 0;
    812
    9                 if ( $('body.admin-bar').length )
    10                         adminbar_height = 28;
     13                if ( $('body.admin-bar').length ) {
     14                        adminbar_height = parseInt( jQuery('#wpadminbar').css('height'), 10 );
     15                }
    1116
    1217                if ( tbWindow.size() ) {
    1318                        tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
    1419                        $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
    15                         tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
    16                         if ( typeof document.body.style.maxWidth != 'undefined' )
    17                                 tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
     20                        tbWindow.css({'margin-left': '-' + parseInt( ( ( W - 50 ) / 2 ), 10 ) + 'px'});
     21                        if ( typeof document.body.style.maxWidth !== 'undefined' )
     22                                tbWindow.css({'top': 20 + adminbar_height + 'px', 'margin-top': '0'});
    1823                }
    1924
    2025                return $('a.thickbox').each( function() {
  • src/wp-admin/js/theme-install.js

     
    2323});
    2424
    2525/**
    26  * Theme Browser Thickbox
    27  *
    28  * Aligns theme browser thickbox.
    29  */
    30 var tb_position;
    31 jQuery(document).ready( function($) {
    32         tb_position = function() {
    33                 var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 1040 < width ) ? 1040 : width, adminbar_height = 0;
    34 
    35                 if ( $('body.admin-bar').length ) {
    36                         adminbar_height = 28;
    37                 }
    38 
    39                 if ( tbWindow.size() ) {
    40                         tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );
    41                         $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );
    42                         tbWindow.css({'margin-left': '-' + parseInt( ( ( W - 50 ) / 2 ), 10 ) + 'px'});
    43                         if ( typeof document.body.style.maxWidth !== 'undefined' ) {
    44                                 tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
    45                         }
    46                 }
    47         };
    48 
    49         $(window).resize(function(){ tb_position(); });
    50 });
    51 
    52 /**
    5326 * Theme Install
    5427 *
    5528 * Displays theme previews on theme install pages.
  • src/wp-admin/js/theme.js

     
    661661);
    662662
    663663})( jQuery );
     664
     665// Align theme browser thickbox
     666var tb_position;
     667jQuery(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 = parseInt( jQuery('#wpadminbar').css('height'), 10 );
     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
     689        $(window).resize(function(){ tb_position(); });
     690});