fix(app): fix page return to top after changing tab

Close #56
pull/88/head
tibing 2016-06-22 11:46:32 +03:00
parent 7c7574d099
commit 96b3a8b585
8 changed files with 13 additions and 8 deletions

View File

@ -19,7 +19,7 @@
.state('charts', {
url: '/charts',
abstract: true,
template: '<div ui-view></div>',
template: '<div ui-view autoscroll="true"></div>',
title: 'Charts',
sidebarMeta: {
icon: 'ion-stats-bars',

View File

@ -17,7 +17,7 @@
$stateProvider
.state('components', {
url: '/components',
template : '<ui-view></ui-view>',
template : '<ui-view autoscroll="true"></ui-view>',
abstract: true,
title: 'Components',
sidebarMeta: {

View File

@ -13,7 +13,7 @@
$stateProvider
.state('form', {
url: '/form',
template : '<ui-view></ui-view>',
template : '<ui-view autoscroll="true"></ui-view>',
abstract: true,
title: 'Form Elements',
sidebarMeta: {

View File

@ -1,7 +1,7 @@
<div class="widgets">
<div class="row">
<div class="col-md-12" ui-view></div>
<div class="col-md-12" ui-view autoscroll="true"></div>
</div>
</div>

View File

@ -13,7 +13,7 @@
$stateProvider
.state('tables', {
url: '/tables',
template : '<ui-view></ui-view>',
template : '<ui-view autoscroll="true"></ui-view>',
abstract: true,
controller: 'TablesPageCtrl',
title: 'Tables',

View File

@ -25,7 +25,7 @@
$stateProvider
.state('ui', {
url: '/ui',
template : '<ui-view></ui-view>',
template : '<ui-view autoscroll="true"></ui-view>',
abstract: true,
title: 'UI Features',
sidebarMeta: {

View File

@ -9,7 +9,12 @@
.config(config);
/** @ngInject */
function config(baConfigProvider, colorHelper) {
function config(baConfigProvider, colorHelper, $provide) {
$provide.decorator('$uiViewScroll', function ($delegate) {
return function (uiViewElement) {
window.scrollTo(0, 0);
};
});
//baConfigProvider.changeTheme({blur: true});
//
//baConfigProvider.changeColors({

View File

@ -34,7 +34,7 @@
<div class="al-main">
<div class="al-content">
<content-top></content-top>
<div ui-view></div>
<div ui-view autoscroll="true"></div>
</div>
</div>