@@ -259,8 +259,12 jsToolBar.prototype = { | |||
|
259 | 259 | subst = prefix + res + suffix; |
|
260 | 260 | |
|
261 | 261 | if (typeof(document["selection"]) != "undefined") { |
|
262 |
|
|
|
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); |
General Comments 0
You need to be logged in to leave comments.
Login now