Changeset 263
- Timestamp:
- 05/07/08 23:25:24 (7 months ago)
- Files:
-
- trunk/common/Editor/Textarea.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/common/Editor/Textarea.js
r210 r263 16 16 arguments.callee.applySuper( this, arguments ); 17 17 this.editor = editor; 18 this.range = null; 18 19 }, 19 20 20 21 21 22 destroyObject: function() { 23 this.range = null; 22 24 this.editor = null; 23 25 arguments.callee.applySuper( this, arguments ); … … 31 33 32 34 getHTML: function() { 35 var selection = this.getSelection(); 36 if ( selection.createRange ) { 37 this.focus(); 38 this.range = selection.createRange().duplicate(); 39 } 33 40 return this.element.value; 34 41 }, … … 142 149 if ( selection.createRange ) { 143 150 // ie 151 this.range = null; 144 152 this.focus(); 145 153 var range = selection.createRange(); … … 160 168 var selection = this.getSelection(); 161 169 if ( selection.createRange ) { 162 this.focus(); 163 var range = selection.createRange(); 170 var range = this.range; 171 if ( !range ) { 172 this.focus(); 173 range = selection.createRange(); 174 } 164 175 range.text = txt; 176 range.select(); 165 177 } else { 166 178 var scrollTop = el.scrollTop;
