diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-07 22:46:47 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-06-07 22:46:47 +0000 |
commit | ceab24db2a7bf459684a650c287770b4ff090f54 (patch) | |
tree | 171760af3de53f07b77c12d8e7931241a8d0377e /mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/autoresize/editor_plugin_src.js | |
parent | d924a462f39ff922a4cc9f6635cfe5d0c0f14db3 (diff) | |
download | elgg-ceab24db2a7bf459684a650c287770b4ff090f54.tar.gz elgg-ceab24db2a7bf459684a650c287770b4ff090f54.tar.bz2 |
Refs #3510, #9113. Updated tinyMCE version in trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@9140 36083f99-b078-4883-b0ff-0f9b5a30f544
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.js | 15 |
1 files changed, 12 insertions, 3 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 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 +})(); |