Browse Source

Fixed a bug that caused ever-growing notes in Internet Explorer 8.

Dan Helfman 9 years ago
parent
commit
9d101ff1be
2 changed files with 6 additions and 3 deletions
  1. 3
    0
      NEWS
  2. 3
    3
      static/js/Editor.js

+ 3
- 0
NEWS View File

@@ -1,3 +1,6 @@
1
+1.6.17: July 26, 2009
2
+ * Fixed a bug that caused ever-growing notes in Internet Explorer 8.
3
+
1 4
 1.6.16: July 14, 2009
2 5
  * Fixed a bug that prevented the new note button from working in Internet
3 6
    Explorer. This fixes Luminotes support for Internet Explorer 8.

+ 3
- 3
static/js/Editor.js View File

@@ -427,7 +427,7 @@ Editor.prototype.position_cursor = function ( div_range ) {
427 427
       selection.addRange( range );
428 428
       return;
429 429
     }
430
-  } else if ( div_range && this.document.selection ) { // browsers such as IE
430
+  } else if ( div_range && this.document && this.document.selection ) { // browsers such as IE
431 431
     function text_length( text ) {
432 432
       var count = 0;
433 433
       for ( var i = 0; i < text.length; i++ ) {
@@ -470,7 +470,7 @@ Editor.prototype.position_cursor = function ( div_range ) {
470 470
     range.selectNodeContents( last_node );
471 471
     range.collapse( false );
472 472
     selection.addRange( range );
473
-  } else if ( this.document.selection ) { // browsers such as IE
473
+  } else if ( this.document && this.document.selection ) { // browsers such as IE
474 474
     var range = this.document.selection.createRange();
475 475
     range.move( "textedit" );
476 476
     range.select();
@@ -671,7 +671,7 @@ Editor.prototype.resize = function ( get_height_from_div ) {
671 671
     height -= FRAME_BORDER_HEIGHT * 2; // 2 pixels at the top and 2 at the bottom
672 672
   // if no height is given, get the height from this editor's document body
673 673
   } else {
674
-    if ( this.iframe && this.iframe.contentDocument && !WEBKIT ) { // Gecko and other sane browsers
674
+    if ( this.iframe && this.iframe.contentDocument && GECKO ) { // Gecko and other sane browsers
675 675
       height = elementDimensions( this.document.documentElement ).h;
676 676
     } else { // IE
677 677
       height = this.document.body.scrollHeight;