@@ -259,8 +259,12 jsToolBar.prototype = { | |||||
259 | subst = prefix + res + suffix; |
|
259 | subst = prefix + res + suffix; | |
260 |
|
260 | |||
261 | if (typeof(document["selection"]) != "undefined") { |
|
261 | if (typeof(document["selection"]) != "undefined") { | |
262 |
|
|
262 | document.selection.createRange().text = subst; | |
263 | this.textarea.caretPos -= suffix.length; |
|
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 | } else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { |
|
268 | } else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { | |
265 | this.textarea.value = this.textarea.value.substring(0, start) + subst + |
|
269 | this.textarea.value = this.textarea.value.substring(0, start) + subst + | |
266 | this.textarea.value.substring(end); |
|
270 | this.textarea.value.substring(end); |
General Comments 0
You need to be logged in to leave comments.
Login now