Skip to content

Instantly share code, notes, and snippets.

@akzhan akzhan/gist:960576 forked from croaky/gist:960553
Created May 7, 2011

Embed
What would you like to do?
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
You can’t perform that action at this time.