Skip to content

Commit

Permalink
Permitiendo que todos respondan la wea que quieran
Browse files Browse the repository at this point in the history
  • Loading branch information
lfalvarez committed Sep 10, 2018
1 parent 7ac1b56 commit c6dd714
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
32 changes: 32 additions & 0 deletions merepresenta/static/js/perguntas_match.js
@@ -0,0 +1,32 @@

$(function(){
$('.options input[type="checkbox"]:checked').parent().parent().addClass('cat-selected');
$('.options input[type="checkbox"]').change(function(el){

let is_selected = $(this).prop("checked");
let amount_of_selected = $('.options input[type="checkbox"]:checked').length;

$(this).parent().parent().removeClass('cat-selected cat-unselected');
if(is_selected){
$(this).parent().parent().addClass('cat-selected');
}
else{
$(this).parent().parent().addClass('cat-unselected');
}

});

});
$(function(){

let $element = $('.radio input[type="radio"]')
let $checked = $('.radio input[type="radio"]:checked')

$checked.parent().parent().addClass('option-selected');

$element.click(function() {
$(this).parent().parent().addClass("option-selected");
$(this).parent().parent().siblings().removeClass("option-selected");
});

});
1 change: 0 additions & 1 deletion merepresenta/templates/base.html
Expand Up @@ -151,7 +151,6 @@ <h4>Apoio</h4>
<script src="{% static 'js/analytics.js' %}"></script>
<script src="{% static 'js/bootstrap-datepicker.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
<script src="{% static 'js/pautas.js' %}"></script>
<script src="{% static 'js/merepresenta.js' %}"></script>
<script src="{% static 'js/navbar.js' %}"></script>
<script src="{% static 'js/jquery-ui.js' %}"></script>
Expand Down
2 changes: 1 addition & 1 deletion merepresenta/templates/match/pergunta.html
Expand Up @@ -36,5 +36,5 @@
{% endblock content %}

{% block scripts %}
<script type="text/javascript" src="{% static 'js/pautas.js' %}"></script>
<script type="text/javascript" src="{% static 'js/perguntas_match.js' %}"></script>
{% endblock scripts %}

0 comments on commit c6dd714

Please sign in to comment.