]> source.dussan.org Git - redmine.git/commitdiff
Jump to end of line for ul, ol and quote when line is empty (#33958).
authorGo MAEDA <maeda@farend.jp>
Tue, 8 Sep 2020 06:48:34 +0000 (06:48 +0000)
committerGo MAEDA <maeda@farend.jp>
Tue, 8 Sep 2020 06:48:34 +0000 (06:48 +0000)
Patch by Felix Gliesche.

git-svn-id: http://svn.redmine.org/redmine/trunk@20009 e93f8b46-1217-0410-a6f0-8f06a7374b81

public/javascripts/jstoolbar/jstoolbar.js

index 0a2d454e85d386353967e0845bbbdf2a6c426c62..376698f9a360516079f99524a26ecaca1d234cd2 100644 (file)
@@ -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);