Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@croaky
Created May 7, 2011 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save croaky/960553 to your computer and use it in GitHub Desktop.
Save croaky/960553 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