From 8d8472029d09391148073d7a1bbb73b97c0f8543 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Mon, 8 Feb 2016 08:42:19 -0500 Subject: [PATCH] Better textarea sizing --- routes.go | 5 ++++- templates/index.tmpl | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/routes.go b/routes.go index d9118c4..9456278 100644 --- a/routes.go +++ b/routes.go @@ -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, }) } } diff --git a/templates/index.tmpl b/templates/index.tmpl index b3c0563..c1b07ba 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -73,7 +73,7 @@
-