From a5651cabe4979404f76462b2305b87a4f70d1c35 Mon Sep 17 00:00:00 2001 From: Leonardo Merlin Date: Mon, 16 Nov 2015 16:13:18 -0200 Subject: [PATCH] Fix #33 - Menu Tema no Celular --- src/app/index.run.js | 13 +++++++++++++ 1 file changed, 13 insertions(+), 0 deletions(-) diff --git a/src/app/index.run.js b/src/app/index.run.js index 3258d04..5986da8 100644 --- a/src/app/index.run.js +++ b/src/app/index.run.js @@ -11,6 +11,7 @@ .run(runHistory) .run(runPath) .run(runSocialAuth) + .run(runScroll) .run(runUtils) .run(runBlock); @@ -214,6 +215,18 @@ } /** @ngInject */ + function runScroll($rootScope, jQuery) { + $rootScope.$on('change-selectedCategory', function(){ + var $resultEl = jQuery('.section--articles .header'); + + if($resultEl && $resultEl.length > 0){ + $rootScope.scrollTo($resultEl); + // angular.element('body').animate({scrollTop: $resultEl.offset().top}, 'fast'); + } + }); + } + + /** @ngInject */ function runUtils($rootScope) { $rootScope.stripHtml = function(text) { return String(text).replace(/<[^>]+>/gm, ''); -- libgit2 0.21.2