From 7c7574d099c6e1541e21928c5c7f6bb2cd3c922e Mon Sep 17 00:00:00 2001 From: tibing Date: Wed, 22 Jun 2016 11:46:32 +0300 Subject: [PATCH] fix(app): fix page return to top after changing tab Close #56 --- src/app/app.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/app.js b/src/app/app.js index 4a34c74..3d28a4d 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -15,4 +15,10 @@ angular.module('BlurAdmin', [ 'BlurAdmin.theme', 'BlurAdmin.pages' -]); \ No newline at end of file +]).run(scrollTop); + +function scrollTop($rootScope) { + $rootScope.$on('$stateChangeSuccess', function(){ + window.scrollTo(0, 0); + }); +} \ No newline at end of file