From 95caf0726d2504f82b817235b5a3a6b92a94e6ac Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 10 Sep 2020 06:24:03 +0000 Subject: [PATCH] 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 --- public/javascripts/jstoolbar/jstoolbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.39.5