witten
/
luminotes
Archived
1
0
Fork 0

Don't resize if there's no document.

This commit is contained in:
Dan Helfman 2008-03-12 00:40:02 +00:00
parent 22228f5a2c
commit 34bc8cb849
1 changed files with 2 additions and 1 deletions

View File

@ -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 };
}