From 0dfa6f388f2eaa07d5f7954819d5eecd475275cf Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Mon, 8 Feb 2016 08:42:19 -0500 Subject: [PATCH] Better textarea sizing Former-commit-id: b95674262c650244b0f3b5fd1f8fa068a3a077b2 [formerly db0f23ffd78991ea70d40cc2b5461ae60781fb20] [formerly d42da1260349e8f1d28410055f51209982ae741d [formerly 9a6960a2cba5417bf1da5e2690bda3138bd954a0 [formerly 8d8472029d09391148073d7a1bbb73b97c0f8543]]] Former-commit-id: 146f6397367a9068498fb358f4c1ea5ad6425524 [formerly bc6267772c95b5820ab234ac5f8b4cd1aa525358] Former-commit-id: b756d6b503d6e0e77a6b6ea5c1cd606489169b28 Former-commit-id: 2ef00a010fa17e9ea7a340b9f56ba57455b1d1cc --- 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 @@
-