Commit 7c0e4240 by Tasawer Nawaz Committed by GitHub

Merge pull request #484 from edx/tasawer/ECOM-6579-fix-js-issue

Fix js issue on comment page
parents 82d7c4f9 f90776b1
$(document).ready(function() {
var box = $('#id_comment');
$("#id_submit").click(function(event){
if( !box.val() ) {
box.addClass('has-error');
box.focus();
}
else{
$("#frm_comment").submit();
}
});
});
{% load i18n %}
{% load staticfiles %}
{% load comments %}
{% if user.is_authenticated and comment_object %}
<div class="comments-container">
<p>{% trans 'Add new comment' %}</p>
......@@ -13,7 +13,7 @@
{{ form.object_pk }}
{{ form.timestamp }}
{{ form.security_hash }}
<input type="hidden" name="next" value="{{ comment_object.post_back_url }}"/>
<input type="hidden" name="next" value="{% url 'publisher:publisher_course_run_detail' object.id %}"/>
<div>
<input type="button" value="Add comment" id="id_submit" class="btn-brand btn-base" />
</div>
......@@ -21,21 +21,3 @@
</div>
</div>
{% endif %}
{% block extra_js %}
<script type="text/javascript">
$(document).ready(function() {
var box = $('#id_comment');
$("#id_submit").click(function(event){
if( !box.val() ) {
box.addClass('has-error');
box.focus();
}
else{
$("#frm_comment").submit();
}
});
});
</script>
{% endblock %}
......@@ -68,6 +68,7 @@
{% block extra_js %}
<script src="{% static 'bower_components/clipboard/dist/clipboard.min.js' %}"></script>
<script src="{% static 'js/publisher/publisher.js' %}"></script>
<script src="{% static 'js/publisher/comments.js' %}"></script>
<script>
new Clipboard(".btn-copy", {
text: function(trigger) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment