File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 101101 } ) ;
102102 layout ( ) ;
103103 } ) ;
104- scope . $watch ( 'items' , layout ) ;
104+ scope . $watch ( 'items' , function ( ) {
105+ lastScrollPosition = Number . NEGATIVE_INFINITY ;
106+ layout ( ) ;
107+ } ) ;
105108 scope . $on ( 'td.tileview.resize' , layout ) ;
106109 angular . element ( $window ) . on ( 'resize' , onResize ) ;
107110 scope . $on ( '$destroy' , function ( ) {
127130 function itemElementCount ( ) {
128131 return itemContainer . children ( ) . length ;
129132 }
130- var lastScrollPosition = 0 ;
133+ var lastScrollPosition = Number . NEGATIVE_INFINITY ;
131134 function updateVisibleRows ( ) {
132135 function clamp ( value , min , max ) {
133136 return Math . max ( Math . min ( value , max ) , min ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " angular-tileview" ,
3- "version" : " 0.3.2 " ,
3+ "version" : " 0.3.3 " ,
44 "description" : " A tileview for angular" ,
55 "main" : " gulpfile.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -110,7 +110,10 @@ declare const angular: any;
110110 } ) ;
111111 layout ( ) ;
112112 } ) ;
113- scope . $watch ( 'items' , layout ) ;
113+ scope . $watch ( 'items' , ( ) => {
114+ lastScrollPosition = Number . NEGATIVE_INFINITY ;
115+ layout ( ) ;
116+ } ) ;
114117 scope . $on ( 'td.tileview.resize' , layout ) ;
115118
116119 angular . element ( $window ) . on ( 'resize' , onResize ) ;
@@ -143,7 +146,7 @@ declare const angular: any;
143146 return itemContainer . children ( ) . length ;
144147 }
145148
146- let lastScrollPosition = 0 ;
149+ let lastScrollPosition = Number . NEGATIVE_INFINITY ;
147150 function updateVisibleRows ( ) {
148151 function clamp ( value , min , max ) {
149152 return Math . max ( Math . min ( value , max ) , min ) ;
You can’t perform that action at this time.
0 commit comments