mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Better textarea sizing
This commit is contained in:
parent
21c840857a
commit
8d8472029d
@ -29,10 +29,13 @@ func editNote(c *gin.Context) {
|
|||||||
if locked {
|
if locked {
|
||||||
c.Redirect(302, "/"+title+"/view")
|
c.Redirect(302, "/"+title+"/view")
|
||||||
} else {
|
} else {
|
||||||
|
currentText := getCurrentText(title)
|
||||||
|
numRows := len(strings.Split(currentText, "\n")) + 10
|
||||||
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
c.HTML(http.StatusOK, "index.tmpl", gin.H{
|
||||||
"Title": title,
|
"Title": title,
|
||||||
"ExternalIP": RuntimeArgs.ExternalIP,
|
"ExternalIP": RuntimeArgs.ExternalIP,
|
||||||
"CurrentText": getCurrentText(title),
|
"CurrentText": currentText,
|
||||||
|
"NumRows": numRows,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
<form action='#' id="emit" method="post" name="emit">
|
<form action='#' id="emit" method="post" name="emit">
|
||||||
|
|
||||||
<div>
|
<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.
|
Go to cowyo.com/{{ .Title }} to reload this page.
|
||||||
Do not post anything private.
|
Do not post anything private.
|
||||||
Anyone with the URL can access this note.">{{ .CurrentText }}</textarea>
|
Anyone with the URL can access this note.">{{ .CurrentText }}</textarea>
|
||||||
|
Loading…
Reference in New Issue
Block a user