// 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);
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);