Commit 66ebaf87bbb2a3f5776685655e36f0fc0e310818

Authored by Leonardo Merlin
1 parent ada07a8a

Handle toggle on 'Veja as propostas mais votadas'

src/app/pages/programas/programa-content.controller.js
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 .controller('ProgramaContentPageController', ProgramaContentPageController); 6 .controller('ProgramaContentPageController', ProgramaContentPageController);
7 7
8 /** @ngInject */ 8 /** @ngInject */
9 - function ProgramaContentPageController(DialogaService, $state, $scope, $rootScope, $log) { 9 + function ProgramaContentPageController(DialogaService, $state, $scope, $rootScope, $element, $log) {
10 $log.debug('ProgramaContentPageController'); 10 $log.debug('ProgramaContentPageController');
11 11
12 var vm = this; 12 var vm = this;
@@ -15,6 +15,7 @@ @@ -15,6 +15,7 @@
15 vm.$state = $state; 15 vm.$state = $state;
16 vm.$scope = $scope; 16 vm.$scope = $scope;
17 vm.$rootScope = $rootScope; 17 vm.$rootScope = $rootScope;
  18 + vm.$element = $element;
18 vm.$log = $log; 19 vm.$log = $log;
19 20
20 vm.init(); 21 vm.init();
@@ -79,14 +80,17 @@ @@ -79,14 +80,17 @@
79 // vm.$log.info('Rollback to home page.'); 80 // vm.$log.info('Rollback to home page.');
80 // vm.$state.go('inicio', {}, {location: true}); 81 // vm.$state.go('inicio', {}, {location: true});
81 }); 82 });
82 -  
83 }; 83 };
84 84
85 ProgramaContentPageController.prototype.attachListeners = function() { 85 ProgramaContentPageController.prototype.attachListeners = function() {
86 var vm = this; 86 var vm = this;
87 87
88 vm.$scope.$on('proposal-carousel:toProposals', function() { 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,7 +82,7 @@
82 </div> 82 </div>
83 </section> 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 <div class="container"> 86 <div class="container">
87 <div class="proposal-ranking-section-header"> 87 <div class="proposal-ranking-section-header">
88 <h3 class="color-theme-fg">Resultados de propostas mais votadas</h3> 88 <h3 class="color-theme-fg">Resultados de propostas mais votadas</h3>