From ceab24db2a7bf459684a650c287770b4ff090f54 Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 7 Jun 2011 22:46:47 +0000 Subject: Refs #3510, #9113. Updated tinyMCE version in trunk. git-svn-id: http://code.elgg.org/elgg/trunk@9140 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../tiny_mce/plugins/autoresize/editor_plugin_src.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 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 c260b7a24..50af21aac 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 @@ -26,7 +26,7 @@ * @param {string} url Absolute URL to where the plugin is located. */ init : function(ed, url) { - var t = this; + var t = this, oldSize = 0; if (ed.getParam('fullscreen_is_enabled')) return; @@ -40,12 +40,18 @@ // Get height differently depending on the browser used myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight; + // Bottom margin + myHeight = t.bottom_margin + myHeight; + // Don't make it smaller than the minimum height if (myHeight > t.autoresize_min_height) resizeHeight = myHeight; // Resize content element - DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); + if ( resizeHeight !== oldSize ) { + DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px'); + oldSize = resizeHeight; + } // if we're throbbing, we'll re-throb to match the new size if (t.throbbing) { @@ -59,6 +65,9 @@ // Define minimum height t.autoresize_min_height = ed.getElement().offsetHeight; + // Add margin at the bottom for better UX + t.bottom_margin = parseInt( ed.getParam('autoresize_bottom_margin', 50) ); + // Add appropriate listeners for resizing content area ed.onChange.add(resize); ed.onSetContent.add(resize); @@ -116,4 +125,4 @@ // Register plugin tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin); -})(); \ No newline at end of file +})(); -- cgit v1.2.3