]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js
WordPress 3.4
[autoinstalls/wordpress.git] / wp-includes / js / tinymce / plugins / wpfullscreen / editor_plugin_src.js
similarity index 94%
rename from wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin.dev.js
rename to wp-includes/js/tinymce/plugins/wpfullscreen/editor_plugin_src.js
index 6290c11233ba9181c75690cf1a7b6e6e7d050bb8..9d33795f4991f97ad8dde1ae1434773e51a460de 100644 (file)
@@ -8,7 +8,7 @@
        tinymce.create('tinymce.plugins.wpFullscreenPlugin', {
 
                init : function(ed, url) {
-                       var t = this, oldHeight = 0, s = {}, DOM = tinymce.DOM, resized = false;
+                       var t = this, oldHeight = 0, s = {}, DOM = tinymce.DOM;
 
                        // Register commands
                        ed.addCommand('wpFullScreenClose', function() {
@@ -34,7 +34,7 @@
                        ed.addCommand('wpFullScreenInit', function() {
                                var d, b, fsed;
 
-                               ed = tinymce.get('content');
+                               ed = tinyMCE.activeEditor;
                                d = ed.getDoc();
                                b = d.body;
 
                         * This method gets executed each time the editor needs to resize.
                         */
                        function resize() {
-                               if ( resized )
-                                       return;
-
                                var d = ed.getDoc(), DOM = tinymce.DOM, resizeHeight, myHeight;
 
                                // Get height differently depending on the browser used
-                               if ( tinymce.isIE )
-                                       myHeight = d.body.scrollHeight;
+                               if ( tinymce.isWebKit )
+                                       myHeight = d.body.offsetHeight;
                                else
-                                       myHeight = d.documentElement.offsetHeight;
+                                       myHeight = d.body.scrollHeight;
 
                                // Don't make it smaller than 300px
                                resizeHeight = (myHeight > 300) ? myHeight : 300;
 
                                // Resize content element
                                if ( oldHeight != resizeHeight ) {
-                                       oldHeight = resizeHeight;
-                                       resized = true;
-                                       setTimeout(function(){ resized = false; }, 100);
-
                                        DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
+                                       oldHeight = resizeHeight;
+                                       ed.getWin().scrollTo(0,0);
                                }
                        };