From 34bc8cb849bf2ab3ecfe51d6097e9de54d79befa Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 12 Mar 2008 00:40:02 +0000 Subject: [PATCH] Don't resize if there's no document. --- static/js/Editor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/js/Editor.js b/static/js/Editor.js index 9494382..0aae27f 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -288,12 +288,13 @@ Editor.prototype.insert_html = function ( html ) { // resize the editor's frame to fit the dimensions of its content Editor.prototype.resize = function () { + if ( !this.document ) return; + var dimensions; // TODO: find a better way to determine which dimensions to use than just checking for contentDocument if ( this.iframe.contentDocument ) { // Firefox dimensions = { "h": elementDimensions( this.document.documentElement ).h }; } else { // IE - if ( !this.document ) return; dimensions = { "h": this.document.body.scrollHeight }; }