Skip to content

Instantly share code, notes, and snippets.

@akzhan
Forked from croaky/gist:960553
Created May 7, 2011 15:19
Show Gist options
  • Save akzhan/960576 to your computer and use it in GitHub Desktop.
Save akzhan/960576 to your computer and use it in GitHub Desktop.
7ccc3b4 [5 days ago] (Mike Burns) Fix resizing bug with the editor WYSIWYG
diff --git a/public/javascripts/jquery.wysiwyg.js b/public/javascripts/jquery.wysiwyg.js
index 37ae000..961398b 100644
--- a/public/javascripts/jquery.wysiwyg.js
+++ b/public/javascripts/jquery.wysiwyg.js
@@ -1327,26 +1327,6 @@
.mousedown(function () { self.autoSaveFunction(); })
.bind($.support.noCloneEvent ? "input.wysiwyg" : "paste.wysiwyg", function () { self.autoSaveFunction(); });
}
-
- if (self.options.autoGrow) {
- if (self.options.initialMinHeight !== null) {
- self.ui.initialHeight = self.options.initialMinHeight;
- } else {
- self.ui.initialHeight = $(self.editorDoc).height();
- }
- $(self.editorDoc.body).css("border", "1px solid white"); // cancel margin collapsing
-
- growHandler = function () {
- self.ui.grow();
- };
-
- $(self.editorDoc).keyup(growHandler);
- $(self.editorDoc).bind("editorRefresh.wysiwyg", growHandler);
-
- // fix when content height > textarea height
- self.ui.grow();
- }
-
if (self.options.css) {
if (String === self.options.css.constructor) {
if ($.browser.msie) {
@@ -1424,6 +1404,25 @@
$(self.editorDoc).bind("cut.wysiwyg", saveHandler);
}
}
+
+ if (self.options.autoGrow) {
+ if (self.options.initialMinHeight !== null) {
+ self.ui.initialHeight = self.options.initialMinHeight;
+ } else {
+ self.ui.initialHeight = $(self.editorDoc).height();
+ }
+ $(self.editorDoc.body).css("border", "1px solid white"); // cancel margin collapsing
+
+ growHandler = function () {
+ self.ui.grow();
+ };
+
+ $(self.editorDoc).keyup(growHandler);
+ $(self.editorDoc).bind("editorRefresh.wysiwyg", growHandler);
+
+ // fix when content height > textarea height
+ self.ui.grow();
+ }
/**
* XHTML5 {@link https://github.com/akzhan/jwysiwyg/issues/152}
@@ -1451,6 +1450,8 @@
});
});
}
+
+
};
this.innerDocument = function () {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment