Explorar o código

js: set cursor to the end of autofocus input string

Unknwon %!s(int64=8) %!d(string=hai) anos
pai
achega
3c0de17133
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      public/js/gogs.js

+ 5 - 0
public/js/gogs.js

@@ -1153,6 +1153,11 @@ function initWebhookSettings() {
 $(document).ready(function () {
     csrf = $('meta[name=_csrf]').attr("content");
     suburl = $('meta[name=_suburl]').attr("content");
+    
+    // Set cursor to the end of autofocus input string
+    $('input[autofocus]').each(function () {
+        $(this).val($(this).val());
+    })
 
     // Show exact time
     $('.time-since').each(function () {