]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/TinyMCE/js/plugins/autoresize/editor_plugin_src.js
Update TinyMCE to release 3.3.8, jQuery version
[quix0rs-gnu-social.git] / plugins / TinyMCE / js / plugins / autoresize / editor_plugin_src.js
index 37709f562955faa5ea314ccf2bb345bfcb15015a..c260b7a24f542784832d3b7e09a81152451848af 100644 (file)
                        // 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);