File tree 3 files changed +11
-5
lines changed
3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 101
101
} ) ;
102
102
layout ( ) ;
103
103
} ) ;
104
- scope . $watch ( 'items' , layout ) ;
104
+ scope . $watch ( 'items' , function ( ) {
105
+ lastScrollPosition = Number . NEGATIVE_INFINITY ;
106
+ layout ( ) ;
107
+ } ) ;
105
108
scope . $on ( 'td.tileview.resize' , layout ) ;
106
109
angular . element ( $window ) . on ( 'resize' , onResize ) ;
107
110
scope . $on ( '$destroy' , function ( ) {
127
130
function itemElementCount ( ) {
128
131
return itemContainer . children ( ) . length ;
129
132
}
130
- var lastScrollPosition = 0 ;
133
+ var lastScrollPosition = Number . NEGATIVE_INFINITY ;
131
134
function updateVisibleRows ( ) {
132
135
function clamp ( value , min , max ) {
133
136
return Math . max ( Math . min ( value , max ) , min ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " angular-tileview" ,
3
- "version" : " 0.3.2 " ,
3
+ "version" : " 0.3.3 " ,
4
4
"description" : " A tileview for angular" ,
5
5
"main" : " gulpfile.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -110,7 +110,10 @@ declare const angular: any;
110
110
} ) ;
111
111
layout ( ) ;
112
112
} ) ;
113
- scope . $watch ( 'items' , layout ) ;
113
+ scope . $watch ( 'items' , ( ) => {
114
+ lastScrollPosition = Number . NEGATIVE_INFINITY ;
115
+ layout ( ) ;
116
+ } ) ;
114
117
scope . $on ( 'td.tileview.resize' , layout ) ;
115
118
116
119
angular . element ( $window ) . on ( 'resize' , onResize ) ;
@@ -143,7 +146,7 @@ declare const angular: any;
143
146
return itemContainer . children ( ) . length ;
144
147
}
145
148
146
- let lastScrollPosition = 0 ;
149
+ let lastScrollPosition = Number . NEGATIVE_INFINITY ;
147
150
function updateVisibleRows ( ) {
148
151
function clamp ( value , min , max ) {
149
152
return Math . max ( Math . min ( value , max ) , min ) ;
You can’t perform that action at this time.
0 commit comments