Changeset 22772
- Timestamp:
- 11/21/2012 04:50:13 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/media-editor.js
r22770 r22772 46 46 } 47 47 48 // thickbox settings49 var tb_position;50 (function($) {51 tb_position = function() {52 var tbWindow = $('#TB_window'), width = $(window).width(), H = $(window).height(), W = ( 720 < width ) ? 720 : width, adminbar_height = 0;53 54 if ( $('body.admin-bar').length )55 adminbar_height = 28;56 57 if ( tbWindow.size() ) {58 tbWindow.width( W - 50 ).height( H - 45 - adminbar_height );59 $('#TB_iframeContent').width( W - 50 ).height( H - 75 - adminbar_height );60 tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});61 if ( typeof document.body.style.maxWidth != 'undefined' )62 tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});63 };64 65 return $('a.thickbox').each( function() {66 var href = $(this).attr('href');67 if ( ! href ) return;68 href = href.replace(/&width=[0-9]+/g, '');69 href = href.replace(/&height=[0-9]+/g, '');70 $(this).attr( 'href', href + '&width=' + ( W - 80 ) + '&height=' + ( H - 85 - adminbar_height ) );71 });72 };73 74 $(window).resize(function(){ tb_position(); });75 76 // store caret position in IE77 $(document).ready(function($){78 $('a.thickbox').click(function(){79 var ed;80 81 if ( typeof(tinymce) != 'undefined' && tinymce.isIE && ( ed = tinymce.get(wpActiveEditor) ) && !ed.isHidden() ) {82 ed.focus();83 ed.windowManager.insertimagebookmark = ed.selection.getBookmark();84 }85 });86 });87 88 })(jQuery);89 90 48 // WordPress, TinyMCE, and Media 91 49 // -----------------------------
Note: See TracChangeset
for help on using the changeset viewer.