Don't resize if there's no document.
This commit is contained in:
parent
22228f5a2c
commit
34bc8cb849
|
@ -288,12 +288,13 @@ Editor.prototype.insert_html = function ( html ) {
|
||||||
|
|
||||||
// resize the editor's frame to fit the dimensions of its content
|
// resize the editor's frame to fit the dimensions of its content
|
||||||
Editor.prototype.resize = function () {
|
Editor.prototype.resize = function () {
|
||||||
|
if ( !this.document ) return;
|
||||||
|
|
||||||
var dimensions;
|
var dimensions;
|
||||||
// TODO: find a better way to determine which dimensions to use than just checking for contentDocument
|
// TODO: find a better way to determine which dimensions to use than just checking for contentDocument
|
||||||
if ( this.iframe.contentDocument ) { // Firefox
|
if ( this.iframe.contentDocument ) { // Firefox
|
||||||
dimensions = { "h": elementDimensions( this.document.documentElement ).h };
|
dimensions = { "h": elementDimensions( this.document.documentElement ).h };
|
||||||
} else { // IE
|
} else { // IE
|
||||||
if ( !this.document ) return;
|
|
||||||
dimensions = { "h": this.document.body.scrollHeight };
|
dimensions = { "h": this.document.body.scrollHeight };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue