Defect #92 ยป toolbar_fix_for_ie.patch
public/javascripts/jstoolbar.js (working copy) | ||
---|---|---|
259 | 259 |
subst = prefix + res + suffix; |
260 | 260 |
|
261 | 261 |
if (typeof(document["selection"]) != "undefined") { |
262 |
var range = document.selection.createRange().text = subst; |
|
263 |
this.textarea.caretPos -= suffix.length; |
|
262 |
document.selection.createRange().text = subst; |
|
263 |
var range = this.textarea.createTextRange(); |
|
264 |
range.collapse(false); |
|
265 |
range.move('character', -suffix.length); |
|
266 |
range.select(); |
|
267 |
// this.textarea.caretPos -= suffix.length; |
|
264 | 268 |
} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { |
265 | 269 |
this.textarea.value = this.textarea.value.substring(0, start) + subst + |
266 | 270 |
this.textarea.value.substring(end); |