Commit 66ebaf87bbb2a3f5776685655e36f0fc0e310818
1 parent
ada07a8a
Exists in
master
and in
8 other branches
Handle toggle on 'Veja as propostas mais votadas'
Showing
2 changed files
with
8 additions
and
4 deletions
Show diff stats
src/app/pages/programas/programa-content.controller.js
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | .controller('ProgramaContentPageController', ProgramaContentPageController); |
| 7 | 7 | |
| 8 | 8 | /** @ngInject */ |
| 9 | - function ProgramaContentPageController(DialogaService, $state, $scope, $rootScope, $log) { | |
| 9 | + function ProgramaContentPageController(DialogaService, $state, $scope, $rootScope, $element, $log) { | |
| 10 | 10 | $log.debug('ProgramaContentPageController'); |
| 11 | 11 | |
| 12 | 12 | var vm = this; |
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 | vm.$state = $state; |
| 16 | 16 | vm.$scope = $scope; |
| 17 | 17 | vm.$rootScope = $rootScope; |
| 18 | + vm.$element = $element; | |
| 18 | 19 | vm.$log = $log; |
| 19 | 20 | |
| 20 | 21 | vm.init(); |
| ... | ... | @@ -79,14 +80,17 @@ |
| 79 | 80 | // vm.$log.info('Rollback to home page.'); |
| 80 | 81 | // vm.$state.go('inicio', {}, {location: true}); |
| 81 | 82 | }); |
| 82 | - | |
| 83 | 83 | }; |
| 84 | 84 | |
| 85 | 85 | ProgramaContentPageController.prototype.attachListeners = function() { |
| 86 | 86 | var vm = this; |
| 87 | 87 | |
| 88 | 88 | vm.$scope.$on('proposal-carousel:toProposals', function() { |
| 89 | - vm.$log.warn('TODO: handle see proposals / ranking'); | |
| 89 | + if(!vm._proposal_list){ | |
| 90 | + vm._proposal_list = vm.$element.find('.proposal-ranking-section'); | |
| 91 | + } | |
| 92 | + | |
| 93 | + vm._proposal_list.slideToggle(); | |
| 90 | 94 | }); |
| 91 | 95 | }; |
| 92 | 96 | ... | ... |
src/app/pages/programas/programa.html
| ... | ... | @@ -82,7 +82,7 @@ |
| 82 | 82 | </div> |
| 83 | 83 | </section> |
| 84 | 84 | |
| 85 | - <section class="proposal-ranking-section" ng-if="pageProgramaContent.proposals && pageProgramaContent.proposals.length > 0"> | |
| 85 | + <section class="proposal-ranking-section" style="display:none;" ng-if="pageProgramaContent.proposals && pageProgramaContent.proposals.length > 0"> | |
| 86 | 86 | <div class="container"> |
| 87 | 87 | <div class="proposal-ranking-section-header"> |
| 88 | 88 | <h3 class="color-theme-fg">Resultados de propostas mais votadas</h3> | ... | ... |