Skip to content

Commit

Permalink
Reset list view when menu item clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
gregapompe committed Apr 24, 2015
1 parent 482c977 commit e15dc3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ var ListCtrl = function ($scope, $rootScope, $routeParams, $location, Class, Cla

$scope.reset = function () {
$scope.current_page = 1;
$scope.items = [];
$scope.items = [];
$scope.search();
};
$scope.$on('listReset', function(){ $scope.reset()});
Expand Down Expand Up @@ -956,6 +956,11 @@ var ListCtrl = function ($scope, $rootScope, $routeParams, $location, Class, Cla
}
);
};

$rootScope.menu_item_click = function() {
$scope.item.values = {};
$scope.reset();
}

$scope.reset();
};
Expand All @@ -969,7 +974,6 @@ var RootCtrl = function ($scope, $rootScope, $interval, Auth, Url, $location, Pl
});



$rootScope.getLoggedInData = function(){
$rootScope.logout = function(){
Auth.logout.save(
Expand Down
2 changes: 1 addition & 1 deletion public/views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<h3 class="panel-title"><i class="fa fa-table fa-fw"></i> {{block.title}}</h3>
</div>
<ul class="nav nav-pills nav-stacked">
<li ng-repeat="link in block.items" data-active-link=""><a href="{{link.url}}" class="">{{link.name}}</a></li>
<li ng-repeat="link in block.items" data-active-link=""><a href="{{link.url}}" class="" ng-click="menu_item_click()">{{link.name}}</a></li>
</ul>
</div>
<div class="panel panel-default" ng-show="user.roles && user.roles.indexOf('admin')">
Expand Down

0 comments on commit e15dc3f

Please sign in to comment.