Ticket #25944: theme-preview.diff
File theme-preview.diff, 1.5 KB (added by , 12 years ago) |
---|
-
src/wp-admin/js/theme-preview.js
1 1 /* global tb_click */ 2 2 var thickDims, tbWidth, tbHeight; 3 3 jQuery(document).ready(function($) { 4 4 … … 12 12 tbWindow.width(w).height(h); 13 13 $('#TB_iframeContent').width(w).height(h - 27); 14 14 tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'}); 15 if ( typeof document.body.style.maxWidth != 'undefined' )15 if ( typeof document.body.style.maxWidth !== 'undefined' ) { 16 16 tbWindow.css({'top':'30px','margin-top':'0'}); 17 } 17 18 } 18 19 }; 19 20 20 21 thickDims(); 21 $(window).resize( function() { thickDims() } );22 $(window).resize( function() { thickDims(); } ); 22 23 23 24 $('a.thickbox-preview').click( function() { 24 25 tb_click.call(this); 25 26 26 27 var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text; 27 28 28 if ( tbWidth = href.match(/&tbWidth=[0-9]+/) ) 29 if ( tbWidth = href.match(/&tbWidth=[0-9]+/) ) { 29 30 tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10); 30 else31 } else { 31 32 tbWidth = $(window).width() - 90; 33 } 32 34 33 if ( tbHeight = href.match(/&tbHeight=[0-9]+/) ) 35 if ( tbHeight = href.match(/&tbHeight=[0-9]+/) ) { 34 36 tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10); 35 else37 } else { 36 38 tbHeight = $(window).height() - 60; 39 } 37 40 38 41 if ( alink.length ) { 39 42 url = alink.attr('href') || '';