Changeset 27941
- Timestamp:
- 04/04/2014 01:30:11 AM (12 years ago)
- Location:
- trunk/src/wp-admin/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/editor.js
r27761 r27941 14 14 // mode can be 'html', 'tmce', or 'toggle'; 'html' is used for the 'Text' editor tab. 15 15 go: function( id, mode ) { 16 var t = this, ed, wrap_id, txtarea_el, editorHeight, toolbarHeight,16 var t = this, ed, wrap_id, txtarea_el, iframe, editorHeight, toolbarHeight, 17 17 DOM = tinymce.DOM; //DOMUtils outside the editor iframe 18 18 … … 33 33 34 34 function getToolbarHeight() { 35 var height; 36 37 try { 38 height = DOM.getSize( DOM.select( '.mce-toolbar-grp', ed.getContainer() )[0] ); 39 } catch(e){} 40 41 if ( height && height.h && height.h > 10 && height.h < 100 ) { 42 return height.h; 43 } 44 45 return 0; 35 var node = DOM.select( '.mce-toolbar-grp', ed.getContainer() )[0], 36 height = node && node.clientHeight; 37 38 if ( height && height > 10 && height < 200 ) { 39 return parseInt( height, 10 ); 40 } 41 42 return 30; 46 43 } 47 44 … … 64 61 ed.show(); 65 62 66 if ( editorHeight && ( toolbarHeight = getToolbarHeight() ) ) { 67 editorHeight = editorHeight - toolbarHeight + 11; 63 if ( editorHeight ) { 64 toolbarHeight = getToolbarHeight(); 65 editorHeight = editorHeight - toolbarHeight + 14; 68 66 69 67 // height cannot be under 50 or over 5000 … … 74 72 } else { 75 73 tinymce.init( tinyMCEPreInit.mceInit[id] ); 76 77 // ed = tinymce.createEditor( id, tinyMCEPreInit.mceInit[id] );78 // ed.render();79 74 } 80 75 … … 90 85 91 86 if ( ed ) { 92 editorHeight = DOM.get( id + '_ifr' ); 93 editorHeight = editorHeight ? parseInt( editorHeight.style.height, 10 ) : 0; 94 95 if ( editorHeight && ( toolbarHeight = getToolbarHeight() ) ) { 96 editorHeight = editorHeight + toolbarHeight - 11; 87 iframe = DOM.get( id + '_ifr' ); 88 editorHeight = iframe ? parseInt( iframe.style.height, 10 ) : 0; 89 90 if ( editorHeight ) { 91 toolbarHeight = getToolbarHeight(); 92 editorHeight = editorHeight + toolbarHeight - 14; 97 93 98 94 // height cannot be under 50 or over 5000 -
trunk/src/wp-admin/js/post.js
r27783 r27941 1015 1015 editor.focus(); 1016 1016 toolbarHeight = $( '#wp-content-editor-container .mce-toolbar-grp' ).height(); 1017 1018 if ( toolbarHeight < 10 || toolbarHeight > 200 ) { 1019 toolbarHeight = 30; 1020 } 1021 1017 1022 height = parseInt( $('#content_ifr').css('height'), 10 ) + toolbarHeight - 28; 1018 1023 } else { … … 1021 1026 } 1022 1027 1023 $document.off( ' mousemove.wp-editor-resize mouseup.wp-editor-resize' );1028 $document.off( '.wp-editor-resize' ); 1024 1029 1025 1030 // sanity check … … 1046 1051 1047 1052 $document.on( 'mousemove.wp-editor-resize', dragging ) 1048 .on( 'mouseup.wp-editor-resize ', endDrag );1049 1050 event.preventDefault(); 1051 }) ;1053 .on( 'mouseup.wp-editor-resize mouseleave.wp-editor-resize', endDrag ); 1054 1055 event.preventDefault(); 1056 }).on( 'mouseup.wp-editor-resize', endDrag ); 1052 1057 })(); 1053 1058
Note: See TracChangeset
for help on using the changeset viewer.