From 2be122cb5032567e88bb926b8aac250fd488cf68 Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Tue, 4 Oct 2011 20:59:33 -0700 Subject: Refs #3853. Upgraded TinyMCE to 3.4.6. Embed still inserts the content in the wrong place for IE 8. --- .../plugins/autoresize/editor_plugin_src.js | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js') diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js index 50af21aac..7d113419d 100644 --- a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js +++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js @@ -38,17 +38,21 @@ var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight; // Get height differently depending on the browser used - myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight; - - // Bottom margin - myHeight = t.bottom_margin + myHeight; + myHeight = tinymce.isIE ? b.scrollHeight : d.body.offsetHeight; // Don't make it smaller than the minimum height if (myHeight > t.autoresize_min_height) resizeHeight = myHeight; + // If a maximum height has been defined don't exceed this height + if (t.autoresize_max_height && myHeight > t.autoresize_max_height) { + resizeHeight = t.autoresize_max_height; + ed.getBody().style.overflowY = "auto"; + } else + ed.getBody().style.overflowY = "hidden"; + // Resize content element - if ( resizeHeight !== oldSize ) { + if (resizeHeight !== oldSize) { DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); oldSize = resizeHeight; } @@ -63,10 +67,15 @@ t.editor = ed; // Define minimum height - t.autoresize_min_height = ed.getElement().offsetHeight; + t.autoresize_min_height = parseInt( ed.getParam('autoresize_min_height', ed.getElement().offsetHeight) ); + + // Define maximum height + t.autoresize_max_height = parseInt( ed.getParam('autoresize_max_height', 0) ); - // Add margin at the bottom for better UX - t.bottom_margin = parseInt( ed.getParam('autoresize_bottom_margin', 50) ); + // Add padding at the bottom for better UX + ed.onInit.add(function(ed){ + ed.dom.setStyle(ed.getBody(), 'paddingBottom', ed.getParam('autoresize_bottom_margin', 50) + 'px'); + }); // Add appropriate listeners for resizing content area ed.onChange.add(resize); -- cgit v1.2.3