Hide comment form when no annotation selected.
--- a/src/iconolab/templates/iconolab/detail_image.html Thu Feb 23 20:27:39 2017 +0100
+++ b/src/iconolab/templates/iconolab/detail_image.html Fri Feb 24 14:54:06 2017 +0100
@@ -61,7 +61,7 @@
<comment-list v-bind:annotation="annotation"
fetch="{% url 'get_annotation_comments_json' ':annotation_guid' %}"></comment-list>
<div id="form-comment">
- <form>
+ <form style="display: none;">
<div class="form-group">
<textarea class="form-control input-sm" placeholder="Ajouter mon commentaire..." disabled></textarea>
</div>
@@ -109,7 +109,7 @@
$('.list-group a[data-annotation-id]').removeClass('active');
$el.addClass('active');
- $('#form-comment form').replaceWith(form);
+ $('#form-comment form').replaceWith(form).show();
vm.annotation = annotations[revision];
@@ -150,7 +150,10 @@
vm.annotation = null;
- $('#form-comment form').find('textarea, [type="submit"]').attr('disabled', true);
+ $('#form-comment form')
+ .hide()
+ .find('textarea, [type="submit"]')
+ .attr('disabled', true);
location.hash = '';
});