aboutsummaryrefslogtreecommitdiff
path: root/lib/serve.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/serve.js')
-rw-r--r--lib/serve.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/serve.js b/lib/serve.js
index 51a7a5d..e4d5911 100644
--- a/lib/serve.js
+++ b/lib/serve.js
@@ -685,6 +685,10 @@ Serve.prototype.wrapChannel = function (channel) {
})
}
+function rows(str) {
+ return String(str).split(/[^\n]{70}|\n/).length
+}
+
Serve.prototype.composer = function (opts, cb) {
var self = this
opts = opts || {}
@@ -697,7 +701,7 @@ Serve.prototype.composer = function (opts, cb) {
h('textarea', {
id: opts.id,
name: 'text',
- rows: 4,
+ rows: Math.max(4, rows(data.text)),
cols: 70,
placeholder: opts.placeholder || 'public message',
}, data.text || ''),