Commit d90b279261d3c4b346d6b0a43f1ab2c68c43336d
1 parent
35b89afe
Exists in
master
and in
12 other branches
put the navigation bar to works correctly
Showing
2 changed files
with
9 additions
and
11 deletions
Show diff stats
index.html
| @@ -20,8 +20,8 @@ | @@ -20,8 +20,8 @@ | ||
| 20 | <script id='proposal-template' type='text/x-handlebars-template'> | 20 | <script id='proposal-template' type='text/x-handlebars-template'> |
| 21 | <nav> | 21 | <nav> |
| 22 | <ul> | 22 | <ul> |
| 23 | - <li><a href="#proposal-categories" class="active">Temas</a></li> | ||
| 24 | - <li><a href="#proposal-group" class='inactive'>Programas</a></li> | 23 | + <li id='nav-proposal-categories'><a href="#proposal-categories" class="active">Temas</a></li> |
| 24 | + <li id='nav-proposal-group'><a href="#proposal-group">Programas</a></li> | ||
| 25 | </ul> | 25 | </ul> |
| 26 | </nav> | 26 | </nav> |
| 27 | 27 |
js/main.js
| @@ -9,7 +9,9 @@ var resultsPlaceholder = document.getElementById('proposal-result'); | @@ -9,7 +9,9 @@ var resultsPlaceholder = document.getElementById('proposal-result'); | ||
| 9 | 9 | ||
| 10 | var topics; | 10 | var topics; |
| 11 | 11 | ||
| 12 | -var noosferoAPI = 'http://localhost:3000/api/v1/articles?private_token=89419a2d331a17e815c3ecc53b303aac&content_type=ProposalsDiscussionPlugin::Topic&parent_id=377&callback=?'; | 12 | +//var noosferoAPI = 'http://localhost:3000/api/v1/articles?private_token=89419a2d331a17e815c3ecc53b303aac&content_type=ProposalsDiscussionPlugin::Topic&parent_id=377&callback=?'; |
| 13 | + | ||
| 14 | +var noosferoAPI = 'http://www.participa.br/api/v1/articles?private_token=9350c1488fcae884ad955091a3d2d960&content_type=ProposalsDiscussionPlugin::Topic&parent_id=92856&callback=?'; | ||
| 13 | 15 | ||
| 14 | $.getJSON(noosferoAPI) | 16 | $.getJSON(noosferoAPI) |
| 15 | .done(function( data ) { | 17 | .done(function( data ) { |
| @@ -18,16 +20,12 @@ $.getJSON(noosferoAPI) | @@ -18,16 +20,12 @@ $.getJSON(noosferoAPI) | ||
| 18 | var item = this.href.split('#').pop(); | 20 | var item = this.href.split('#').pop(); |
| 19 | if(item == 'proposal-categories'){ | 21 | if(item == 'proposal-categories'){ |
| 20 | $('#proposal-group').hide(); | 22 | $('#proposal-group').hide(); |
| 21 | - var active_tab = $('nav ul li a.active').removeClass('active'); | ||
| 22 | - var inactive_tab = $('nav ul li a.inactive').removeClass('inactive'); | ||
| 23 | - inactive_tab.addClass('active'); | ||
| 24 | - active_tab.addClass('inactive'); | 23 | + $('#nav-proposal-categories a').addClass('active'); |
| 24 | + $('#nav-proposal-group a').removeClass('active'); | ||
| 25 | }else if(item == 'proposal-group'){ | 25 | }else if(item == 'proposal-group'){ |
| 26 | $('#proposal-categories').hide(); | 26 | $('#proposal-categories').hide(); |
| 27 | - var active_tab = $('nav ul li a.active').removeClass('active'); | ||
| 28 | - var inactive_tab = $('nav ul li a.inactive').removeClass('inactive'); | ||
| 29 | - inactive_tab.addClass('active'); | ||
| 30 | - active_tab.addClass('inactive'); | 27 | + $('#nav-proposal-group a').addClass('active'); |
| 28 | + $('#nav-proposal-categories a').removeClass('active'); | ||
| 31 | }else{ | 29 | }else{ |
| 32 | $('#proposal-categories').hide(); | 30 | $('#proposal-categories').hide(); |
| 33 | $('#proposal-group').hide(); | 31 | $('#proposal-group').hide(); |