diff options
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 +})(); |