diff options
author | Maxime Quandalle <maxime@quandalle.com> | 2015-06-06 10:40:39 +0200 |
---|---|---|
committer | Maxime Quandalle <maxime@quandalle.com> | 2015-06-06 10:42:05 +0200 |
commit | a12f094710ed4fc70c1a5a2c59b7834d824989d6 (patch) | |
tree | a27fa311a851e2e288afcd871d31a29c2bce992f | |
parent | 56a240a643ca01c96fb76abc715759ee0f485186 (diff) | |
download | wekan-a12f094710ed4fc70c1a5a2c59b7834d824989d6.tar.gz wekan-a12f094710ed4fc70c1a5a2c59b7834d824989d6.tar.bz2 wekan-a12f094710ed4fc70c1a5a2c59b7834d824989d6.zip |
Autosize the rich editor (for card description and comments)
-rw-r--r-- | .jshintrc | 1 | ||||
-rw-r--r-- | bower.json | 1 | ||||
-rw-r--r-- | client/components/main/editor.jade | 7 | ||||
-rw-r--r-- | client/components/main/editor.js | 2 | ||||
-rw-r--r-- | client/components/main/editor.styl | 2 | ||||
-rw-r--r-- | client/components/main/templates.html | 5 |
6 files changed, 15 insertions, 3 deletions
@@ -43,6 +43,7 @@ // Exported by packages we use "_": false, "$": false, + "autosize": false, "Router": false, "SimpleSchema": false, "getSlug": false, @@ -1,6 +1,7 @@ { "name": "LibreBoard", "dependencies": { + "autosize": "3.0.6", "perfect-scrollbar": "0.6.2" }, "private": true 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> |