- Timestamp:
- 08/30/11 10:50:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/expressoMail1_2/js/rich_text_editor.js
r4450 r5006 6 6 this.buildEditor(); 7 7 this.saveFlag = 0; 8 this.selRng = null; 9 this.selBmk = null; 8 10 } 9 11 … … 66 68 } 67 69 }); 70 71 if (is_ie) { 72 iframe.attachEvent("onbeforedeactivate", function() { 73 RichTextEditor.saveSelection(); 74 }); 75 } 68 76 69 77 parentDiv.appendChild(iframe); … … 392 400 mainField.document.execCommand('inserthtml', false, option); 393 401 } 394 else if (command == 'Image') 402 else if (command == 'Image'){ 403 if (is_ie) { 404 this.restoreSelection(); 405 } 395 406 mainField.document.execCommand('InsertImage', false, option); 396 else if (command == 'spellCheck' && preferences.use_SpellChecker != '0'){ 397 beginSpellCheck(); // configure 398 spellCheck(); // run spellChecker 399 } 407 RichTextEditor.selRng = null; 408 RichTextEditor.selBmk = null; 409 } 410 else if (command == 'spellCheck' && preferences.use_SpellChecker != '0'){ 411 beginSpellCheck(); // configure 412 spellCheck(); // run spellChecker 413 } 400 414 else 401 415 mainField.document.execCommand(command, false, option); … … 669 683 } 670 684 685 cRichTextEditor.prototype.saveSelection = function() { 686 //save last selection for IE 687 try { 688 RichTextEditor.selRng = Element(this.editor).contentWindow.document.selection.createRange(); 689 RichTextEditor.selBmk = RichTextEditor.selRng.getBookmark(); 690 } 691 catch (e) { 692 RichTextEditor.selRng = null; 693 RichTextEditor.selBmk = null; 694 } 695 } 696 697 cRichTextEditor.prototype.restoreSelection = function() { 698 //restablish last selection for IE 699 if (RichTextEditor.selRng!=null) 700 { 701 try { 702 RichTextEditor.selRng.moveToBookmark(RichTextEditor.selBmk); 703 RichTextEditor.selRng.select(); 704 } 705 catch (e) { } 706 } 707 } 708 671 709 //Build the Object 672 710 RichTextEditor = new cRichTextEditor();
Note: See TracChangeset
for help on using the changeset viewer.