Commit c34ac6a2cebe30a4894e7e8cf79125387f66bb22
1 parent
0e565c29
Exists in
master
and in
11 other branches
Category action in proposal detail
Showing
2 changed files
with
7 additions
and
4 deletions
Show diff stats
index.html
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 | <ul id="proposal-categories"> |
33 | 33 | <div id="proposal-categories-container"> |
34 | 34 | {{#each article.categories}} |
35 | - <li id='proposal-category-{{slug}}' class="proposal-category"> | |
35 | + <li id='proposal-category-{{slug}}' class="proposal-category" data-category="{{slug}}"> | |
36 | 36 | {{#link name id}}{{/link}} |
37 | 37 | <div class="arrow-box" style="display: none"></div> |
38 | 38 | </li> |
... | ... | @@ -64,8 +64,8 @@ |
64 | 64 | <div class='categories {{#each categories}}{{slug}} {{/each}}'> |
65 | 65 | <ul> |
66 | 66 | {{#each categories}} |
67 | - <li class='category'> | |
68 | - <a href="#"><span>{{name}}</span></a> | |
67 | + <li class='category proposal-category' data-category="{{slug}}"> | |
68 | + {{#link name id}}{{/link}} | |
69 | 69 | </li> |
70 | 70 | {{/each}} |
71 | 71 | </ul> | ... | ... |
js/main.js
... | ... | @@ -70,11 +70,14 @@ $.getJSON(noosferoAPI) |
70 | 70 | var item = this.href.split('#').pop(); |
71 | 71 | if($('#' + item).hasClass('proposal-category-items')){ |
72 | 72 | //Display Topics or Discussion by category |
73 | + $('#proposal-categories').show(); | |
73 | 74 | $('.proposal-category-items').hide(); |
75 | + $('.proposal-detail').hide(); | |
74 | 76 | $('#' + item).show(); |
75 | 77 | $(".proposal-item").dotdotdot(); |
76 | 78 | $('.proposal-category .arrow-box').hide(); |
77 | - $(this).siblings('.arrow-box').show(); | |
79 | + $(this).parent('.proposal-category').data('category') | |
80 | + $('#proposal-category-'+$(this).parent('.proposal-category').data('category')).find('.arrow-box').show(); | |
78 | 81 | } |
79 | 82 | event.preventDefault(); |
80 | 83 | }); | ... | ... |