Changeset 27941 for trunk/src/wp-admin/js/editor.js
- Timestamp:
- 04/04/2014 01:30:11 AM (10 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.