1
0
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 8d8472029d]]
Former-commit-id: 146f6397367a9068498fb358f4c1ea5ad6425524 [formerly bc6267772c95b5820ab234ac5f8b4cd1aa525358]
Former-commit-id: b756d6b503d6e0e77a6b6ea5c1cd606489169b28
This commit is contained in:
Zack Scholl 2016-02-08 08:42:19 -05:00
parent d0d7e6c1e9
commit 2ef00a010f
2 changed files with 5 additions and 2 deletions

View File

@ -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,
})
}
}

View File

@ -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>