mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Better textarea sizing
Former-commit-id: b95674262c650244b0f3b5fd1f8fa068a3a077b2 [formerly db0f23ffd78991ea70d40cc2b5461ae60781fb20] [formerly d42da1260349e8f1d28410055f51209982ae741d [formerly 9a6960a2cba5417bf1da5e2690bda3138bd954a0 [formerly8d8472029d
]]] Former-commit-id: 146f6397367a9068498fb358f4c1ea5ad6425524 [formerly bc6267772c95b5820ab234ac5f8b4cd1aa525358] Former-commit-id: b756d6b503d6e0e77a6b6ea5c1cd606489169b28 Former-commit-id:2ef00a010f
This commit is contained in:
parent
8f57126dc9
commit
0dfa6f388f
@ -29,10 +29,13 @@ func editNote(c *gin.Context) {
|
||||
if locked {
|
||||
c.Redirect(302, "/"+title+"/view")
|
||||
} else {
|
||||
currentText := getCurrentText(title)
|
||||
numRows := len(strings.Split(currentText, "\n")) + 10
|
||||
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
||||
"Title": title,
|
||||
"ExternalIP": RuntimeArgs.ExternalIP,
|
||||
"CurrentText": getCurrentText(title),
|
||||
"CurrentText": currentText,
|
||||
"NumRows": numRows,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -73,7 +73,7 @@
|
||||
<form action='#' id="emit" method="post" name="emit">
|
||||
|
||||
<div>
|
||||
<textarea autofocus rows=500 class='auto_submit_item' id="emit_data" name="emit_data" placeholder="Start typing, it will save automatically.
|
||||
<textarea autofocus rows={{ .NumRows }} class='auto_submit_item' id="emit_data" name="emit_data" placeholder="Start typing, it will save automatically.
|
||||
Go to cowyo.com/{{ .Title }} to reload this page.
|
||||
Do not post anything private.
|
||||
Anyone with the URL can access this note.">{{ .CurrentText }}</textarea>
|
||||
|
Loading…
Reference in New Issue
Block a user