From d212797f7d929d2b472a772c8335d18cd5205770 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 15 Jan 2009 19:06:05 -0800 Subject: [PATCH] Fix for IE6 error. --- 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 7230b7c..afc6b88 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -280,6 +280,7 @@ Editor.prototype.position_cursor = function ( click_position ) { var FRAME_BORDER_WIDTH = 2; if ( this.iframe.contentWindow && this.iframe.contentWindow.getSelection ) { // browsers such as Firefox + // TODO } else if ( this.document.selection ) { // browsers such as IE var range = this.document.selection.createRange(); range.moveToPoint( @@ -535,7 +536,7 @@ Editor.prototype.resize = function ( height ) { height -= FRAME_BORDER_HEIGHT * 2; // 2 pixels at the top and 2 at the bottom // if no height is given, get the height from this editor's document body } else { - if ( this.iframe.contentDocument && !WEBKIT ) { // Gecko and other sane browsers + if ( this.iframe && this.iframe.contentDocument && !WEBKIT ) { // Gecko and other sane browsers height = elementDimensions( this.document.documentElement ).h; } else { // IE height = this.document.body.scrollHeight;