X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FTinyMCE%2Fjs%2Fplugins%2Fautoresize%2Feditor_plugin_src.js;h=c260b7a24f542784832d3b7e09a81152451848af;hb=bb711cb98d2c63e98b7cb9addf6a0979addaaf3b;hp=37709f562955faa5ea314ccf2bb345bfcb15015a;hpb=819d33210d298de74b64dc7ead79e9d9b223b12e;p=quix0rs-gnu-social.git diff --git a/plugins/TinyMCE/js/plugins/autoresize/editor_plugin_src.js b/plugins/TinyMCE/js/plugins/autoresize/editor_plugin_src.js index 37709f5629..c260b7a24f 100644 --- a/plugins/TinyMCE/js/plugins/autoresize/editor_plugin_src.js +++ b/plugins/TinyMCE/js/plugins/autoresize/editor_plugin_src.js @@ -59,16 +59,6 @@ // Define minimum height t.autoresize_min_height = ed.getElement().offsetHeight; - // Things to do when the editor is ready - ed.onInit.add(function(ed, l) { - // Show throbber until content area is resized properly - ed.setProgressState(true); - t.throbbing = true; - - // Hide scrollbars - ed.getBody().style.overflowY = "hidden"; - }); - // Add appropriate listeners for resizing content area ed.onChange.add(resize); ed.onSetContent.add(resize); @@ -76,20 +66,32 @@ ed.onKeyUp.add(resize); ed.onPostRender.add(resize); - ed.onLoadContent.add(function(ed, l) { - resize(); + if (ed.getParam('autoresize_on_init', true)) { + // Things to do when the editor is ready + ed.onInit.add(function(ed, l) { + // Show throbber until content area is resized properly + ed.setProgressState(true); + t.throbbing = true; - // Because the content area resizes when its content CSS loads, - // and we can't easily add a listener to its onload event, - // we'll just trigger a resize after a short loading period - setTimeout(function() { + // Hide scrollbars + ed.getBody().style.overflowY = "hidden"; + }); + + ed.onLoadContent.add(function(ed, l) { resize(); - // Disable throbber - ed.setProgressState(false); - t.throbbing = false; - }, 1250); - }); + // Because the content area resizes when its content CSS loads, + // and we can't easily add a listener to its onload event, + // we'll just trigger a resize after a short loading period + setTimeout(function() { + resize(); + + // Disable throbber + ed.setProgressState(false); + t.throbbing = false; + }, 1250); + }); + } // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); ed.addCommand('mceAutoResize', resize);