##// END OF EJS Templates
Fixed: cursor not positioned correctly when using wiki toolbar buttons under IE (Balazs Dan)....
Jean-Philippe Lang -
r648:f601d5fb9e02
parent child
Show More
@@ -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 var range = document.selection.createRange().text = subst;
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