Browse Source

pages for pagination

David 10 years ago
parent
commit
99a3f0a180
1 changed files with 8 additions and 0 deletions
  1. 8 0
      front/js/app.js

+ 8 - 0
front/js/app.js

@@ -146,6 +146,14 @@ app.controller('main', function($scope,$http,$sce) {
 		$scope.curPage=newPage; //clamp
 		$scope.filter(newPage);
 	};
+
+	$scope.pages = function() {
+		var arr = [];
+		for(var i=$scope.curPage -2; i<=$scope.curPage+2;i++)
+			if (i>=1 && i<=$scope.totPages)
+				arr.push(i);
+		return arr;
+	};
 	$scope.delete_article = function(id) {
 		$http.get("/pymnts/article/delete/"+id).then(
 			function(data) {