Add rows to textareas for notes/descriptions according to line breaks
This commit is contained in:
@@ -480,8 +480,3 @@ input, input.form-control
|
|||||||
|
|
||||||
#comments-container
|
#comments-container
|
||||||
margin-top: 0
|
margin-top: 0
|
||||||
|
|
||||||
#comments-container
|
|
||||||
.comment-reply-container
|
|
||||||
+container-box
|
|
||||||
padding: 10px 10px 20px 10px
|
|
||||||
|
@@ -24,7 +24,7 @@ html(lang="en")
|
|||||||
body("{% block bodyattrs %}{% if project %}data-project-url='{{ project.url }}'{% endif %}{% endblock %}")
|
body("{% block bodyattrs %}{% if project %}data-project-url='{{ project.url }}'{% endif %}{% endblock %}")
|
||||||
#app-main
|
#app-main
|
||||||
#col_sidebar
|
#col_sidebar
|
||||||
nav.sidebar(role="navigation")
|
nav.sidebar(role='navigation')
|
||||||
ul
|
ul
|
||||||
li
|
li
|
||||||
a.navbar-item.attract(href="{{ url_for('attract.index') }}",
|
a.navbar-item.attract(href="{{ url_for('attract.index') }}",
|
||||||
|
@@ -13,9 +13,10 @@
|
|||||||
|
|
||||||
| {% if 'PUT' in shot.allowed_methods %}
|
| {% if 'PUT' in shot.allowed_methods %}
|
||||||
.input-transparent-group
|
.input-transparent-group
|
||||||
textarea.input-transparent(
|
textarea#item-description.input-transparent(
|
||||||
name="description",
|
name="description",
|
||||||
type="text",
|
type="text",
|
||||||
|
rows=1,
|
||||||
placeholder='Description') {{ shot.description | hide_none }}
|
placeholder='Description') {{ shot.description | hide_none }}
|
||||||
|
|
||||||
.input-transparent-group
|
.input-transparent-group
|
||||||
@@ -27,9 +28,10 @@
|
|||||||
| {% endfor %}
|
| {% endfor %}
|
||||||
|
|
||||||
.input-transparent-group
|
.input-transparent-group
|
||||||
textarea.input-transparent(
|
textarea#item-notes.input-transparent(
|
||||||
name="notes",
|
name="notes",
|
||||||
type="text",
|
type="text",
|
||||||
|
rows=1,
|
||||||
placeholder='Notes') {{ shot.properties.notes | hide_none }}
|
placeholder='Notes') {{ shot.properties.notes | hide_none }}
|
||||||
|
|
||||||
.input-group-separator
|
.input-group-separator
|
||||||
@@ -118,3 +120,16 @@ script.
|
|||||||
loadComments("{{ url_for('nodes.comments_for_node', node_id=shot['_id']) }}");
|
loadComments("{{ url_for('nodes.comments_for_node', node_id=shot['_id']) }}");
|
||||||
|
|
||||||
$('.js-help').openModalUrl('Help', "{{ url_for('attract.help', project_url=project.url) }}");
|
$('.js-help').openModalUrl('Help', "{{ url_for('attract.help', project_url=project.url) }}");
|
||||||
|
|
||||||
|
/* Resize textareas */
|
||||||
|
var textAreaFields = $('#item-description, #item-notes');
|
||||||
|
|
||||||
|
textAreaFields.each(function(){
|
||||||
|
var descriptionText = $(this).val(),
|
||||||
|
matches = descriptionText.match(/\n/g),
|
||||||
|
breaks = matches ? matches.length : 2;
|
||||||
|
|
||||||
|
if (descriptionText){
|
||||||
|
$(this).attr('rows', breaks + 2);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
@@ -161,8 +161,6 @@ script.
|
|||||||
matches = descriptionText.match(/\n/g),
|
matches = descriptionText.match(/\n/g),
|
||||||
breaks = matches ? matches.length : 2;
|
breaks = matches ? matches.length : 2;
|
||||||
|
|
||||||
console.log(matches);
|
|
||||||
|
|
||||||
if (descriptionText){
|
if (descriptionText){
|
||||||
descriptionField.attr('rows',breaks + 4);
|
descriptionField.attr('rows',breaks + 4);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user