Commit bce15107c89b525f5de0ddabc5b2621856285502

Authored by Leonardo Merlin
1 parent d3bb6db7

Fix scroll bug - Fixes #41

src/app/components/app-navbar/app-navbar.directive.js
... ... @@ -19,7 +19,7 @@
19 19  
20 20 // NavbarController.prototype.scrollTo = function (hash){
21 21 // var $el = angular.element('#' + hash);
22   - // angular.element('body').animate({scrollTop: $el.offset().top}, 'slow');
  22 + // angular.element('html,body').animate({scrollTop: $el.offset().top}, 'slow');
23 23 // };
24 24  
25 25 NavbarController.prototype.onClickLogout = function (){
... ...
src/app/components/topic-list/topic-list.directive.js
... ... @@ -55,7 +55,7 @@
55 55  
56 56 if (!angular.equals({}, vm.search)) {
57 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 61 // update window location params
... ...
src/app/pages/inicio/inicio.controller.js
... ... @@ -156,7 +156,7 @@
156 156 }
157 157  
158 158 vm.$timeout(function() {
159   - angular.element('body').animate({scrollTop: scrollTop}, 'fast');
  159 + angular.element('html,body').animate({scrollTop: scrollTop}, 'fast');
160 160 }, 0); // force queue
161 161 }
162 162 };
... ... @@ -222,7 +222,7 @@
222 222 // scroll to result grid
223 223 var $searchResult = angular.element('#search-result');
224 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 226 vm.filtredPrograms = vm.getFiltredPrograms();
227 227 }else {
228 228 vm.$log.warn('#search-result element not found.');
... ...
src/app/pages/programas/programa.controller.js
... ... @@ -181,7 +181,7 @@
181 181 vm.$timeout(function() {
182 182 var target = angular.element('.focused-proposal');
183 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 186 }, 300);
187 187 }
... ... @@ -248,7 +248,7 @@
248 248 var vm = this;
249 249 var el = vm.$element.find(rule);
250 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 254 ProgramaPageController.prototype.findAndHide = function(rule) {
... ...
src/app/pages/programas/programas.controller.js
... ... @@ -147,7 +147,7 @@
147 147 // scroll to result grid
148 148 var $searchResult = angular.element('#search-result');
149 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 151 vm.filtredPrograms = vm.getFiltredPrograms();
152 152 }else {
153 153 vm.$log.warn('#search-result element not found.');
... ...
src/app/pages/propostas/propostas.controller.js
... ... @@ -170,7 +170,7 @@
170 170 // scroll to result grid
171 171 var $searchResult = angular.element('#search-result');
172 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 174 vm.filterProposals();
175 175 }else {
176 176 vm.$log.warn('#search-result element not found.');
... ...