aboutsummaryrefslogtreecommitdiff
path: root/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2011-10-04 20:59:33 -0700
committerBrett Profitt <brett.profitt@gmail.com>2011-10-04 20:59:33 -0700
commit2be122cb5032567e88bb926b8aac250fd488cf68 (patch)
treed8900899a18f29d39c39380bec119823f38f34e5 /mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js
parent34a7e57ef205362d6c093fa7234ca38977560bea (diff)
downloadelgg-2be122cb5032567e88bb926b8aac250fd488cf68.tar.gz
elgg-2be122cb5032567e88bb926b8aac250fd488cf68.tar.bz2
Refs #3853. Upgraded TinyMCE to 3.4.6. Embed still inserts the content in the wrong place for IE 8.
Diffstat (limited to 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js')
-rw-r--r--mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js25
1 files changed, 17 insertions, 8 deletions
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);