This repository was archived by the owner on May 29, 2019. It is now read-only.
File tree 1 file changed +14
-14
lines changed
1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,20 @@ angular.module('ui.bootstrap.pagination', [])
21
21
} else {
22
22
this . itemsPerPage = config . itemsPerPage ;
23
23
}
24
+
25
+ $scope . $watch ( 'totalItems' , function ( ) {
26
+ $scope . totalPages = self . calculateTotalPages ( ) ;
27
+ } ) ;
28
+
29
+ $scope . $watch ( 'totalPages' , function ( value ) {
30
+ setNumPages ( $scope . $parent , value ) ; // Readonly variable
31
+
32
+ if ( $scope . page > value ) {
33
+ $scope . selectPage ( value ) ;
34
+ } else {
35
+ ngModelCtrl . $render ( ) ;
36
+ }
37
+ } ) ;
24
38
} ;
25
39
26
40
this . calculateTotalPages = function ( ) {
@@ -48,20 +62,6 @@ angular.module('ui.bootstrap.pagination', [])
48
62
$scope . noNext = function ( ) {
49
63
return $scope . page === $scope . totalPages ;
50
64
} ;
51
-
52
- $scope . $watch ( 'totalItems' , function ( ) {
53
- $scope . totalPages = self . calculateTotalPages ( ) ;
54
- } ) ;
55
-
56
- $scope . $watch ( 'totalPages' , function ( value ) {
57
- setNumPages ( $scope . $parent , value ) ; // Readonly variable
58
-
59
- if ( $scope . page > value ) {
60
- $scope . selectPage ( value ) ;
61
- } else {
62
- ngModelCtrl . $render ( ) ;
63
- }
64
- } ) ;
65
65
} ] )
66
66
67
67
. constant ( 'paginationConfig' , {
You can’t perform that action at this time.
0 commit comments