Commit 9e274da979d80c97c53d4ff3aea7b18156732da1
Exists in
master
and in
6 other branches
Merge branch 'fix-issues'
Showing
10 changed files
with
30 additions
and
16 deletions
Show diff stats
src/app/components/app-navbar/app-navbar.directive.js
| @@ -9,17 +9,25 @@ | @@ -9,17 +9,25 @@ | ||
| 9 | function appNavbar() { | 9 | function appNavbar() { |
| 10 | 10 | ||
| 11 | /** @ngInject */ | 11 | /** @ngInject */ |
| 12 | - function NavbarController($log) { | 12 | + function NavbarController(AuthService, $log) { |
| 13 | $log.debug('NavbarController'); | 13 | $log.debug('NavbarController'); |
| 14 | 14 | ||
| 15 | var vm = this; | 15 | var vm = this; |
| 16 | - | ||
| 17 | - vm.scrollTo = function(hash) { | ||
| 18 | - var $el = angular.element('#' + hash); | ||
| 19 | - angular.element('body').animate({scrollTop: $el.offset().top}, 'slow'); | ||
| 20 | - }; | 16 | + vm.AuthService = AuthService; |
| 17 | + vm.$log = $log; | ||
| 21 | } | 18 | } |
| 22 | 19 | ||
| 20 | + // NavbarController.prototype.scrollTo = function (hash){ | ||
| 21 | + // var $el = angular.element('#' + hash); | ||
| 22 | + // angular.element('html,body').animate({scrollTop: $el.offset().top}, 'slow'); | ||
| 23 | + // }; | ||
| 24 | + | ||
| 25 | + NavbarController.prototype.onClickLogout = function (){ | ||
| 26 | + var vm = this; | ||
| 27 | + | ||
| 28 | + vm.AuthService.logout(); | ||
| 29 | + }; | ||
| 30 | + | ||
| 23 | var directive = { | 31 | var directive = { |
| 24 | restrict: 'E', | 32 | restrict: 'E', |
| 25 | templateUrl: 'app/components/app-navbar/app-navbar.html', | 33 | templateUrl: 'app/components/app-navbar/app-navbar.html', |
src/app/components/app-navbar/app-navbar.html
| @@ -22,6 +22,11 @@ | @@ -22,6 +22,11 @@ | ||
| 22 | 22 | ||
| 23 | <div id="navbar-collapse" class="collapse navbar-collapse"> | 23 | <div id="navbar-collapse" class="collapse navbar-collapse"> |
| 24 | <ul class="nav navbar-nav navbar-right"> | 24 | <ul class="nav navbar-nav navbar-right"> |
| 25 | + <li class="hidden-sm hidden-md hidden-lg"> | ||
| 26 | + <a ng-show="$root.currentUser === undefined" ui-sref="entrar">Entrar</a> | ||
| 27 | + <a ng-show="$root.currentUser !== undefined" href="#" ng-click="vm.onClickLogout()">Sair</a> | ||
| 28 | + </li> | ||
| 29 | + <li ui-sref-active="active"><a ui-sref="inicio">Início</a></li> | ||
| 25 | <li ui-sref-active="active"><a ui-sref="sobre">Sobre</a></li> | 30 | <li ui-sref-active="active"><a ui-sref="sobre">Sobre</a></li> |
| 26 | <li ui-sref-active="active"><a ui-sref="programas">Programas</a></li> | 31 | <li ui-sref-active="active"><a ui-sref="programas">Programas</a></li> |
| 27 | <li ui-sref-active="active"><a ui-sref="propostas">Propostas</a></li> | 32 | <li ui-sref-active="active"><a ui-sref="propostas">Propostas</a></li> |
| @@ -33,7 +38,7 @@ | @@ -33,7 +38,7 @@ | ||
| 33 | <social-share class="dropdown-menu dropdown-menu-right" arrow-class="social-share--arrow"></social-share> | 38 | <social-share class="dropdown-menu dropdown-menu-right" arrow-class="social-share--arrow"></social-share> |
| 34 | <div class="clearfix"></div> | 39 | <div class="clearfix"></div> |
| 35 | </li> | 40 | </li> |
| 36 | - <li class="hidden-sm hidden-md hidden-lg" style="border: none; padding-bottom: 10px !important;"> | 41 | + <li class="hidden-sm hidden-md hidden-lg" style="border: none; margin-top: 15px; padding-bottom: 10px !important;"> |
| 37 | <div class="text text-right" style="padding-right: 20px;">DIALOGA <b>NAS REDES</b></div> | 42 | <div class="text text-right" style="padding-right: 20px;">DIALOGA <b>NAS REDES</b></div> |
| 38 | <ul class="social-share list-inline"> | 43 | <ul class="social-share list-inline"> |
| 39 | <li> | 44 | <li> |
src/app/components/article-service/article.service.js
src/app/components/auth/auth.service.js
| @@ -204,7 +204,7 @@ | @@ -204,7 +204,7 @@ | ||
| 204 | function logout () { | 204 | function logout () { |
| 205 | 205 | ||
| 206 | Session.destroy(); | 206 | Session.destroy(); |
| 207 | - $rootScope.currentUser = null; | 207 | + $rootScope.currentUser = undefined; |
| 208 | $rootScope.$broadcast(AUTH_EVENTS.logoutSuccess); | 208 | $rootScope.$broadcast(AUTH_EVENTS.logoutSuccess); |
| 209 | } | 209 | } |
| 210 | 210 |
src/app/components/proposal-box/proposal-box.html
| @@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
| 17 | <div class="row"> | 17 | <div class="row"> |
| 18 | <div class="col-xs-12"> | 18 | <div class="col-xs-12"> |
| 19 | <div class="feedback" ng-if="vm.STATE === vm.VOTE_STATUS.SUCCESS"> | 19 | <div class="feedback" ng-if="vm.STATE === vm.VOTE_STATUS.SUCCESS"> |
| 20 | - <p class="feedback--title">Obrigado por apoiar<br/>esta proposta!</p> | 20 | + <p class="feedback--title">Obrigado por participar!</p> |
| 21 | 21 | ||
| 22 | <!-- actions --> | 22 | <!-- actions --> |
| 23 | <div class="row feedback--message"> | 23 | <div class="row feedback--message"> |
src/app/components/topic-list/topic-list.directive.js
| @@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
| 55 | 55 | ||
| 56 | if (!angular.equals({}, vm.search)) { | 56 | if (!angular.equals({}, vm.search)) { |
| 57 | var $el = vm.$element; | 57 | var $el = vm.$element; |
| 58 | - angular.element('body').animate({scrollTop: $el.offset().top}, 'slow'); | 58 | + angular.element('html,body').animate({scrollTop: $el.offset().top}, 'slow'); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | // update window location params | 61 | // update window location params |
src/app/pages/inicio/inicio.controller.js
| @@ -156,7 +156,7 @@ | @@ -156,7 +156,7 @@ | ||
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | vm.$timeout(function() { | 158 | vm.$timeout(function() { |
| 159 | - angular.element('body').animate({scrollTop: scrollTop}, 'fast'); | 159 | + angular.element('html,body').animate({scrollTop: scrollTop}, 'fast'); |
| 160 | }, 0); // force queue | 160 | }, 0); // force queue |
| 161 | } | 161 | } |
| 162 | }; | 162 | }; |
| @@ -222,7 +222,7 @@ | @@ -222,7 +222,7 @@ | ||
| 222 | // scroll to result grid | 222 | // scroll to result grid |
| 223 | var $searchResult = angular.element('#search-result'); | 223 | var $searchResult = angular.element('#search-result'); |
| 224 | if ($searchResult && $searchResult.length > 0) { | 224 | if ($searchResult && $searchResult.length > 0) { |
| 225 | - angular.element('body').animate({scrollTop: $searchResult.offset().top}, 'fast'); | 225 | + angular.element('html,body').animate({scrollTop: $searchResult.offset().top}, 'fast'); |
| 226 | vm.filtredPrograms = vm.getFiltredPrograms(); | 226 | vm.filtredPrograms = vm.getFiltredPrograms(); |
| 227 | }else { | 227 | }else { |
| 228 | vm.$log.warn('#search-result element not found.'); | 228 | vm.$log.warn('#search-result element not found.'); |
src/app/pages/programas/programa.controller.js
| @@ -181,7 +181,7 @@ | @@ -181,7 +181,7 @@ | ||
| 181 | vm.$timeout(function() { | 181 | vm.$timeout(function() { |
| 182 | var target = angular.element('.focused-proposal'); | 182 | var target = angular.element('.focused-proposal'); |
| 183 | if (target && target.length > 0) { | 183 | if (target && target.length > 0) { |
| 184 | - angular.element('body').animate({scrollTop: target.offset().top}, 'fast'); | 184 | + angular.element('html,body').animate({scrollTop: target.offset().top}, 'fast'); |
| 185 | } | 185 | } |
| 186 | }, 300); | 186 | }, 300); |
| 187 | } | 187 | } |
| @@ -248,7 +248,7 @@ | @@ -248,7 +248,7 @@ | ||
| 248 | var vm = this; | 248 | var vm = this; |
| 249 | var el = vm.$element.find(rule); | 249 | var el = vm.$element.find(rule); |
| 250 | el.slideDown(); | 250 | el.slideDown(); |
| 251 | - angular.element('body').animate({scrollTop: el.offset().top}, 'fast'); | 251 | + angular.element('html,body').animate({scrollTop: el.offset().top}, 'fast'); |
| 252 | }; | 252 | }; |
| 253 | 253 | ||
| 254 | ProgramaPageController.prototype.findAndHide = function(rule) { | 254 | ProgramaPageController.prototype.findAndHide = function(rule) { |
src/app/pages/programas/programas.controller.js
| @@ -147,7 +147,7 @@ | @@ -147,7 +147,7 @@ | ||
| 147 | // scroll to result grid | 147 | // scroll to result grid |
| 148 | var $searchResult = angular.element('#search-result'); | 148 | var $searchResult = angular.element('#search-result'); |
| 149 | if ($searchResult && $searchResult.length > 0) { | 149 | if ($searchResult && $searchResult.length > 0) { |
| 150 | - angular.element('body').animate({scrollTop: $searchResult.offset().top}, 'fast'); | 150 | + angular.element('html,body').animate({scrollTop: $searchResult.offset().top}, 'fast'); |
| 151 | vm.filtredPrograms = vm.getFiltredPrograms(); | 151 | vm.filtredPrograms = vm.getFiltredPrograms(); |
| 152 | }else { | 152 | }else { |
| 153 | vm.$log.warn('#search-result element not found.'); | 153 | vm.$log.warn('#search-result element not found.'); |
src/app/pages/propostas/propostas.controller.js
| @@ -170,7 +170,7 @@ | @@ -170,7 +170,7 @@ | ||
| 170 | // scroll to result grid | 170 | // scroll to result grid |
| 171 | var $searchResult = angular.element('#search-result'); | 171 | var $searchResult = angular.element('#search-result'); |
| 172 | if ($searchResult && $searchResult.length > 0) { | 172 | if ($searchResult && $searchResult.length > 0) { |
| 173 | - angular.element('body').animate({scrollTop: $searchResult.offset().top}, 'fast'); | 173 | + angular.element('html,body').animate({scrollTop: $searchResult.offset().top}, 'fast'); |
| 174 | vm.filterProposals(); | 174 | vm.filterProposals(); |
| 175 | }else { | 175 | }else { |
| 176 | vm.$log.warn('#search-result element not found.'); | 176 | vm.$log.warn('#search-result element not found.'); |