Commit a5651cabe4979404f76462b2305b87a4f70d1c35
1 parent
2095c76f
Exists in
master
and in
6 other branches
Fix #33 - Menu Tema no Celular
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
src/app/index.run.js
@@ -11,6 +11,7 @@ | @@ -11,6 +11,7 @@ | ||
11 | .run(runHistory) | 11 | .run(runHistory) |
12 | .run(runPath) | 12 | .run(runPath) |
13 | .run(runSocialAuth) | 13 | .run(runSocialAuth) |
14 | + .run(runScroll) | ||
14 | .run(runUtils) | 15 | .run(runUtils) |
15 | .run(runBlock); | 16 | .run(runBlock); |
16 | 17 | ||
@@ -214,6 +215,18 @@ | @@ -214,6 +215,18 @@ | ||
214 | } | 215 | } |
215 | 216 | ||
216 | /** @ngInject */ | 217 | /** @ngInject */ |
218 | + function runScroll($rootScope, jQuery) { | ||
219 | + $rootScope.$on('change-selectedCategory', function(){ | ||
220 | + var $resultEl = jQuery('.section--articles .header'); | ||
221 | + | ||
222 | + if($resultEl && $resultEl.length > 0){ | ||
223 | + $rootScope.scrollTo($resultEl); | ||
224 | + // angular.element('body').animate({scrollTop: $resultEl.offset().top}, 'fast'); | ||
225 | + } | ||
226 | + }); | ||
227 | + } | ||
228 | + | ||
229 | + /** @ngInject */ | ||
217 | function runUtils($rootScope) { | 230 | function runUtils($rootScope) { |
218 | $rootScope.stripHtml = function(text) { | 231 | $rootScope.stripHtml = function(text) { |
219 | return String(text).replace(/<[^>]+>/gm, ''); | 232 | return String(text).replace(/<[^>]+>/gm, ''); |