From: Go MAEDA Date: Thu, 10 Sep 2020 06:24:03 +0000 (+0000) Subject: Merged r20009 from trunk to 4.1-stable (#33958). X-Git-Tag: 4.1.2~31 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=95caf0726d2504f82b817235b5a3a6b92a94e6ac;p=redmine.git Merged r20009 from trunk to 4.1-stable (#33958). git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@20011 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/public/javascripts/jstoolbar/jstoolbar.js b/public/javascripts/jstoolbar/jstoolbar.js index dccff9952..a815ef570 100644 --- a/public/javascripts/jstoolbar/jstoolbar.js +++ b/public/javascripts/jstoolbar/jstoolbar.js @@ -338,7 +338,7 @@ jsToolBar.prototype = { } else if (typeof(this.textarea["setSelectionRange"]) != "undefined") { this.textarea.value = this.textarea.value.substring(0, start) + subst + this.textarea.value.substring(end); - if (sel) { + if (sel || (!prefix && start === end)) { this.textarea.setSelectionRange(start + subst.length, start + subst.length); } else { this.textarea.setSelectionRange(start + prefix.length, start + prefix.length);