summaryrefslogtreecommitdiffstats
path: root/client/components/main
diff options
context:
space:
mode:
authorMaxime Quandalle <maxime@quandalle.com>2015-06-06 10:40:39 +0200
committerMaxime Quandalle <maxime@quandalle.com>2015-06-06 10:42:05 +0200
commita12f094710ed4fc70c1a5a2c59b7834d824989d6 (patch)
treea27fa311a851e2e288afcd871d31a29c2bce992f /client/components/main
parent56a240a643ca01c96fb76abc715759ee0f485186 (diff)
downloadwekan-a12f094710ed4fc70c1a5a2c59b7834d824989d6.tar.gz
wekan-a12f094710ed4fc70c1a5a2c59b7834d824989d6.tar.bz2
wekan-a12f094710ed4fc70c1a5a2c59b7834d824989d6.zip
Autosize the rich editor (for card description and comments)
Diffstat (limited to 'client/components/main')
-rw-r--r--client/components/main/editor.jade7
-rw-r--r--client/components/main/editor.js2
-rw-r--r--client/components/main/editor.styl2
-rw-r--r--client/components/main/templates.html5
4 files changed, 13 insertions, 3 deletions
diff --git a/client/components/main/editor.jade b/client/components/main/editor.jade
new file mode 100644
index 00000000..cb01cdc1
--- /dev/null
+++ b/client/components/main/editor.jade
@@ -0,0 +1,7 @@
+template(name="editor")
+ textarea.editor(
+ class="{{class}}"
+ id=id
+ autofocus=autofocus
+ placeholder="{{_ 'comment-placeholder'}}")
+ +Template.contentBlock
diff --git a/client/components/main/editor.js b/client/components/main/editor.js
index e1a90cb1..68e278ee 100644
--- a/client/components/main/editor.js
+++ b/client/components/main/editor.js
@@ -3,6 +3,8 @@ var dropdownMenuIsOpened = false;
Template.editor.onRendered(function() {
var $textarea = this.$('textarea');
+ autosize($textarea);
+
$textarea.textcomplete([
// Emojies
{
diff --git a/client/components/main/editor.styl b/client/components/main/editor.styl
new file mode 100644
index 00000000..1dc02047
--- /dev/null
+++ b/client/components/main/editor.styl
@@ -0,0 +1,2 @@
+textarea.editor
+ min-height: 100px
diff --git a/client/components/main/templates.html b/client/components/main/templates.html
index c252f1e4..876eb13a 100644
--- a/client/components/main/templates.html
+++ b/client/components/main/templates.html
@@ -11,8 +11,7 @@
</div>
</template>
-<template name="editor">
- <textarea class="{{class}}" placeholder="{{_ 'comment-placeholder'}}" id="{{id}}" autofocus="{{autofocus}}">{{> UI.contentBlock}}</textarea>
-</template>
+<!-- XXX This should be moved to editor.jade but there is an issue with jade
+ handling of the markdown component. -->
<template name="viewer">{{#markdown}}{{#emoji}}{{#mentions}}{{> UI.contentBlock }}{{/mentions}}{{/emoji}}{{/markdown}}</template>