Commit 5732dc1e61c36af411536bd1ef673cb5de8adc0f
1 parent
0d62f705
Exists in
master
and in
8 other branches
Fix proposal selector
Showing
2 changed files
with
2 additions
and
3 deletions
Show diff stats
js/handlebars-helpers.js
... | ... | @@ -67,7 +67,7 @@ define(['handlebars'], function(Handlebars){ |
67 | 67 | |
68 | 68 | Handlebars.registerHelper('select_proposal', function(proposals, category_slug, selected_id) { |
69 | 69 | var ret = '<label for="proposal-selection" class="sr-only">Selecione o programa</label>' |
70 | - ret = ret + '<select id="proposal-selection" name="proposal-selection" title="Selecione o programa" class="proposal-selection">'; | |
70 | + ret = ret + '<select id="proposal-selection" name="proposal-selection" data-proposal="'+selected_id+'" title="Selecione o programa" class="proposal-selection">'; | |
71 | 71 | |
72 | 72 | for(var i=0; i<proposals.length; i++) { |
73 | 73 | if(!proposal_has_category(proposals[i], category_slug)) continue; | ... | ... |
js/main.js
... | ... | @@ -480,10 +480,9 @@ define(['handlebars','handlebars_helpers'], function(Handlebars){ |
480 | 480 | }); |
481 | 481 | |
482 | 482 | $( '.proposal-selection' ).change(function(e){ |
483 | - e.preventDefault(); | |
484 | - | |
485 | 483 | // Update URL and Navigate |
486 | 484 | Main.updateHash('#/programas/' + this.value); |
485 | + $(this).val($(this).data("proposal")).trigger("chosen:updated"); | |
487 | 486 | }); |
488 | 487 | |
489 | 488 | var availableTags = [ ]; | ... | ... |