Commit a5651cabe4979404f76462b2305b87a4f70d1c35

Authored by Leonardo Merlin
1 parent 2095c76f

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 11 .run(runHistory)
12 12 .run(runPath)
13 13 .run(runSocialAuth)
  14 + .run(runScroll)
14 15 .run(runUtils)
15 16 .run(runBlock);
16 17  
... ... @@ -214,6 +215,18 @@
214 215 }
215 216  
216 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 230 function runUtils($rootScope) {
218 231 $rootScope.stripHtml = function(text) {
219 232 return String(text).replace(/<[^>]+>/gm, '');
... ...