Only make textarea larger if there's text
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
textarea#task-description.input-transparent(
|
textarea#task-description.input-transparent(
|
||||||
name="description",
|
name="description",
|
||||||
type="text",
|
type="text",
|
||||||
|
rows=1,
|
||||||
placeholder='Description') {{ task.description | hide_none }}
|
placeholder='Description') {{ task.description | hide_none }}
|
||||||
|
|
||||||
.input-group-flex
|
.input-group-flex
|
||||||
@@ -155,11 +156,16 @@ script.
|
|||||||
|
|
||||||
{% if 'PUT' in task.allowed_methods %}
|
{% if 'PUT' in task.allowed_methods %}
|
||||||
/* Resize textarea */
|
/* Resize textarea */
|
||||||
var text = $('#task-description').val(),
|
var descriptionField = $('#task-description');
|
||||||
matches = text.match(/\n/g),
|
var descriptionText = descriptionField.val(),
|
||||||
|
matches = descriptionText.match(/\n/g),
|
||||||
breaks = matches ? matches.length : 2;
|
breaks = matches ? matches.length : 2;
|
||||||
|
|
||||||
$('#task-description').attr('rows',breaks + 4);
|
console.log(matches);
|
||||||
|
|
||||||
|
if (descriptionText){
|
||||||
|
descriptionField.attr('rows',breaks + 4);
|
||||||
|
}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
$('.js-help').openModalUrl('Help', "{{ url_for('attract.help', project_url=project.url) }}");
|
$('.js-help').openModalUrl('Help', "{{ url_for('attract.help', project_url=project.url) }}");
|
||||||
|
Reference in New Issue
Block a user